{"id":147,"date":"2024-08-01T21:39:03","date_gmt":"2024-08-02T02:39:03","guid":{"rendered":"https:\/\/arcade.netingredients.com\/discussion\/?p=147"},"modified":"2025-12-10T15:22:59","modified_gmt":"2025-12-10T21:22:59","slug":"donkey-kong-junior-gamepad-support","status":"publish","type":"post","link":"https:\/\/arcade.monkeybusiness.games\/discussion\/donkey-kong-junior\/donkey-kong-junior-gamepad-support\/","title":{"rendered":"Donkey Kong Junior Gamepad Support!"},"content":{"rendered":"\n<p>Recently added gamepad support to the DKJ game. Had to experiment for another project at work, so I thought I&#8217;d play around with it here. Not sure why I didn&#8217;t do this sooner.<\/p>\n\n\n\n<p>Wasn&#8217;t as smooth as I thought, since Phaser doesn&#8217;t have a couple equivalent functions for button\/d-pad presses as it does for key presses. Mostly figured it out, though. I&#8217;m not 100% convinced that the d-pad works as I want it to &#8211; kind of running into the same issues that a 4-direction joystick game has when using an 8-direction game stick. You are able to have both the up and left or right (or down and left and right, etc.) pressed at the same time &#8211; so the question is, which one should prevail? I think it mostly works &#8211; but if anyone plays the game and happens to read this, feel free to drop a comment here to let me know if you think it sucks.<\/p>\n\n\n\n<p><s>It only works with the d-pad for now. I personally think it&#8217;s easier to use than the joysticks (because of the same issues above, but even more so?) I&#8217;ll eventually add support for the joysticks (both?) as well, so hang tight if you prefer to use those&#8230;<\/s><\/p>\n\n\n\n<p>I added support for the <strong>left joystick<\/strong> now as well. I like it better than I thought I would. With the joystick, I can compare the &#8220;magnitude of direction&#8221; for any given direction &#8211; for example, I can determine if the joystick is more &#8220;left&#8221; than it is &#8220;up&#8221; (in this case, I would set left = true and up = false). I don&#8217;t have this luxury with the d-pad, so I may need to rethink the above logic for that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently added gamepad support to the DKJ game. Had to experiment for another project at work, so I thought I&#8217;d play around with it here. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-donkey-kong-junior"],"_links":{"self":[{"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":4,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/posts\/147\/revisions\/152"}],"wp:attachment":[{"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arcade.monkeybusiness.games\/discussion\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}