{"author_name":"quantumpotato","cat":"LD #36","comments":[],"epoch":1471830480,"likes":1,"metadata":{"p_key":"5162","p_author":"quantumpotato","p_authorkey":"36558","p_urlkey":"40617","p_title":"HTML5 + Gamepad (SAMPLE CODE)","p_cat":"LD #36","p_event":"LD36","p_time":"1471830480","p_likes":"1","p_comments":"0","p_status":"UPD5","us_key":"36558","us_name":"quantumpotato","us_username":"quantumpotato","event_start":"1472169600","event_key":"35","event_name":"LD36"},"text":"<p>You want to make something that runs cross platform. You&#8217;re making a 2D game and want a simple but robust engine. You want gamepad support.<\/p>\n <p>Well, here you are! A sample 2D Javascript (ES6) game engine that supports gamepad.<\/p>\n <p><img class=\"alignnone size-medium wp-image-568800\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-21-at-21.47.42-298x300.png\" alt=\"Screen Shot 2016-08-21 at 21.47.42\" width=\"298\" height=\"300\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-21-at-21.47.42-298x300.png 298w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2016\/08\/Screen-Shot-2016-08-21-at-21.47.42.png 384w\" sizes=\"(max-width: 298px) 100vw, 298px\" \/><\/p>\n <p>Objects can install multiple components. Messages sent to an object are heard only by the components who register to listen for them. This is done recursively so you can write modular code. For example, the WallBouncer class found in weapons.js will bounce an object off a wall based on the coordinate passed in for the wall<\/p>\n <p>(In any of the 4 cardinal direction). Both the Ship and Rocket class make use of WallBouncer. Organize your code better to prevent headache!<br \/>\n Plug in an Xbox or PS4 controller, use the left &amp; right shoulder buttons to turn your ship (the blue circle) and the A\/X button to shoot. You and your projectiles bounce off the walls.<\/p>\n <p><a href=\"https:\/\/github.com\/QuantumProductions\/bullet_bouncer\" target=\"_blank\">https:\/\/github.com\/QuantumProductions\/bullet_bouncer<\/a><\/p>","time":"August 21st, 2016 8:48 pm","title":"HTML5 + Gamepad (SAMPLE CODE)"}