 
 Mousetrap = require '../vendor/mousetrap_wrapper'
 KeyboardController = require '../input/keyboard_controller'
-# GamepadController = require('../input/gamepad_controller')
+GamepadController = require('../input/gamepad_controller')
 
 EntityStore = require '../ecs/entity_store'
 Systems = require './systems'

      bindings:
        "g": 'toggle_gamepad'

    # @gamepadController = new GamepadController
    #   "DPAD_RIGHT": 'right'
    #   "DPAD_LEFT": 'left'
    #   "DPAD_UP": 'up'
    #   "DPAD_DOWN": 'down'
    #   "FACE_1": 'jump'
    #   "FACE_3": 'shoot'

    @useGamepad = false
    @p1Controller = @keyboardController


  handleAdminControls: ->
    ac = @adminController.update()
    if ac and ac.toggle_gamepad
      @useGamepad = !@useGamepad
      if @useGamepad
        @p1Controller = @gamepadController
      else
        @p1Controller = @keyboardController
    
  setupMap: (map, container) ->
    @mapTileHeight = 16
