Out of control: Day 5 Update

I’ve added Gamepad support; you can now pan the camera, and test a few other features using a gamepad. I’ve tested with an Xbox Series X controller but should work with any USB or Bluetooth keyboard.

  • D-pad: Move camera
  • Right stick: move camera (analog)
  • Left stick: move cursor
  • A: Shake / Explosion test
  • B: Debug mode toggle
  • X: Editor mode toggle
  • Y: Play/Pause Music
  • Start: Pause/Resume game.

There does seem to be an error where it won’t work on my web server (works fine in my developer machine). I’ll hopefully fix this soon so i can share this with you; it was a lot of work to write a Controls class that can take multiple types of input to perform the same task (Arrow keys, game thumb stick or hovering edges of screen will all move the camera is a smooth a fine controlled way. i.e. analog control with the gamepad or if you pull the mouse a little away from the edge of the screen it’ll scroll proportionately slower.

Next up is touch gestures.

while I was re-writing the controls code I also started adding cursor icons. When you move the camera around by hovering near the edges of the screen it’ll display an arrow to indicate your scrolling; and when you’ve hit the edge of the level it’ll turn red. I’ve realised this isn’t the most intuitive way to do this considering the multiple control methods so I might show a red area on the edge of the screen for a second when you bump in to the edge; this should be more informative for non-mouse ways of scrolling around the map.

I’ve also started work on a user settings option; so that you can remap the buttons amongst other options you may want to teak.

Edit: turns out the controller DOES work, just not in Firefox currently. If you use Edge or Chrome it works fine. A little odd, considering I do all my development using Firefox; just doesn’t work when I upload it to the server.

Leave a Reply

Your email address will not be published. Required fields are marked *