{"id":574,"date":"2022-02-25T22:26:55","date_gmt":"2022-02-26T03:26:55","guid":{"rendered":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/?p=574"},"modified":"2022-02-25T22:26:55","modified_gmt":"2022-02-26T03:26:55","slug":"custom-controller-flappy-drev","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/tedrevitch\/custom-controller-flappy-drev\/","title":{"rendered":"Custom Controller &#8211; Flappy Drev"},"content":{"rendered":"\n<p>With the final week upon us, I was finally able to get my game running semi-properly!  The character jumps when the player presses on the screen and the background moves to the left slower than the pipes to create the illusion of depth in my 2D game.  I also added a label when the player hits the ground or hits a pipe.  The game promptly stops when the player dies instead of continuing to run.  I would prefer if the player would have a better death animation instead of just freezing the screen, but at the very least, it works.  Here is a video of it playing properly:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-content\/uploads\/sites\/22\/2022\/02\/Screen-Recording-2022-02-21-at-8.51.24-PM.mov\"><\/video><\/figure>\n\n\n\n<p>Next step of course was to include a custom controller using the Makey Makey.  Rather than using my previous idea which was to use a broken hockey stick (partially because I didn&#8217;t break any sticks this season&#8230; knock on wood), I connected the Makey Makey to my hockey glove.  When the player pinches their forefinger and their thumb together while wearing the glove, the Makey Makey&#8217;s circuit is complete initiating a &#8216;click&#8217; on the screen.  Every time the player wishes to jump when playing the game, they need to pinch their fingers in the glove.  Here is a video of me playing the game while wearing the hockey glove and using it as a custom controller:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-content\/uploads\/sites\/22\/2022\/02\/IMG_1754.mov\"><\/video><\/figure>\n\n\n\n<p>If I have some extra time before class on Monday, I plan on trying to add the score function (this has been giving me issues&#8230; it works but won&#8217;t show up on the screen yet), and I want to update the graphics more (including adding snow and better looking UI).  If I do not end up having time, I will be fine with that since I have gotten the game working finally, but hopefully I can find time to improve it a bit more before showing it off finally!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the final week upon us, I was finally able to get my game running semi-properly! The character jumps when the player presses on the screen and the background moves to the left slower than the pipes to create the illusion of depth in my 2D game. I also added a label when the player&#8230; <\/p>\n<div class=\"link-more\"><a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/tedrevitch\/custom-controller-flappy-drev\/\">Read More<\/a><\/div>\n","protected":false},"author":255,"featured_media":578,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[24],"tags":[36,35,30],"class_list":["post-574","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-custom-controller","tag-2d-game","tag-custom-controller","tag-flappy-drev"],"jetpack_featured_media_url":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-content\/uploads\/sites\/22\/2022\/02\/Screen-Shot-2022-02-25-at-10.25.24-PM.png","_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/posts\/574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/users\/255"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/comments?post=574"}],"version-history":[{"count":2,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/posts\/574\/revisions"}],"predecessor-version":[{"id":579,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/posts\/574\/revisions\/579"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/media\/578"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/media?parent=574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/categories?post=574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/imgd-fundamentals-22\/wp-json\/wp\/v2\/tags?post=574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}