{"id":57,"date":"2022-08-19T21:08:22","date_gmt":"2022-08-19T09:08:22","guid":{"rendered":"http:\/\/kyleclarke.co.nz\/blog\/?p=57"},"modified":"2022-08-19T21:14:02","modified_gmt":"2022-08-19T09:14:02","slug":"out-of-control-day-5-update","status":"publish","type":"post","link":"http:\/\/kyleclarke.co.nz\/blog\/out-of-control-day-5-update\/","title":{"rendered":"Out of control: Day 5 Update"},"content":{"rendered":"\n<p>I&#8217;ve added Gamepad support; you can now pan the camera, and test a few other features using a gamepad. I&#8217;ve tested with an Xbox Series X controller but should work with any USB or Bluetooth keyboard.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>D-pad: Move camera<\/li><li>Right stick: move camera (analog)<\/li><li>Left stick: move cursor<\/li><li>A: Shake \/ Explosion test<\/li><li>B: Debug mode toggle<\/li><li>X: Editor mode toggle<\/li><li>Y: Play\/Pause Music<\/li><li>Start: Pause\/Resume game.<\/li><\/ul>\n\n\n\n<p>There does seem to be an error where it won&#8217;t work on my web server (works fine in my developer machine). I&#8217;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&#8217;ll scroll proportionately slower.<\/p>\n\n\n\n<p>Next up is touch gestures.<\/p>\n\n\n\n<p>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&#8217;ll display an arrow to indicate your scrolling; and when you&#8217;ve hit the edge of the level it&#8217;ll turn red. I&#8217;ve realised this isn&#8217;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.<\/p>\n\n\n\n<p>I&#8217;ve also started work on a user settings option; so that you can remap the buttons amongst other options you may want to teak.<\/p>\n\n\n\n<p><strong>Edit<\/strong>: turns out the controller DOES work, just not in Firefox currently. If you use <strong>Edge <\/strong>or <strong>Chrome <\/strong>it works fine. A little odd, considering I do all my development using Firefox; just doesn&#8217;t work when I upload it to the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve added Gamepad support; you can now pan the camera, and test a few other features using a gamepad. I&#8217;ve tested with an Xbox Series X controller but should work [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":58,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-57","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-game-dev","category-rts-game-jam"],"_links":{"self":[{"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":3,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":62,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions\/62"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/media\/58"}],"wp:attachment":[{"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kyleclarke.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}