{"author_name":"MiniBobbo","cat":"LD #30","comments":[{"author_name":"Sruloart","time":"August 21, 2014 7:55 am","epoch":1408625700,"text":"This is cool. Very cool. &#8216;This should be in HaxeFlixel&#8217;s addons&#8217; kinda cool. PULL REQUEST AT ONCE! <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/simple-smile.png\" alt=\":)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><br \/>\n BTW, MIT license?","spam":"N"}],"epoch":1408567860,"likes":3,"metadata":{"p_key":"29235","p_author":"MiniBobbo","p_authorkey":"22584","p_urlkey":"64697","p_title":"HaxeFlixel InputHelper","p_cat":"LD #30","p_event":"LD30","p_time":"1408567860","p_likes":"3","p_comments":"1","p_status":"UPD5","us_key":"22584","us_name":"MiniBobbo","us_username":"\/author\/minibobbo\/","event_start":"1408665600","event_key":"24","event_name":"LD30"},"text":"<p>Have you ever received a comment like &#8220;I would like to play this, but I use an AZERTY keyboard layout and the controls are impossible&#8221; or &#8220;I wish that key X did this instead of Y&#8221;? \u00a0Ever spent time hard coding\u00a0user inputs into a game only for it to be a pain to change it around? \u00a0Ever wasted precious time writing a way for users to change their own keys in game? \u00a0Oh, and happen to use HaxeFlixel?<\/p>\n <p>If you answered\u00a0<strong>yes<\/strong> to any of these questions, then you need\u00a0<strong>InputHelper<\/strong>, the new simple way to map keyboard keys to game functions without the hassle, available now for HaxeFlixel for the low, low price of&#8230; <strong>nothing<\/strong>!<\/p>\n <p><strong>InputHelper <\/strong>is a small helper application for HaxeFlixel games. \u00a0It abstracts the interface between the user and the game through a series of virtual buttons that can be mapped to different functions. \u00a0Instead of checking against the keyboard, mouse, or gamepad and updating your game objects, InputHelper has you check against buttons named\u00a0<strong>up, down, left,<\/strong>\u00a0or\u00a0<strong>right\u00a0<\/strong>plus any additional buttons you define.<\/p>\n <p><span id=\"more-370063\"><\/span><\/p>\n <p>Next,\u00a0add any virtual buttons you want with\u00a0<span style=\"font-weight: bold\">InputHelper.addButton(buttonName)<\/span>. \u00a0Does your game need a jump button? \u00a0<strong>InputHelper.addButton(&#8220;jump&#8221;)<\/strong>. \u00a0Attack\u00a0button? \u00a0<strong>InputHelper.addButton(&#8220;attack&#8221;)<\/strong>. \u00a0 \u00a0Throw flaming gopher button? \u00a0<strong>InputHelper.addButton(&#8220;FlamingGopher&#8221;)<\/strong>. \u00a0Now those gophers are ready to fly!!<\/p>\n <div style=\"color: #606060\">Keyboard keys can be assigned to your virtual buttons simply\u00a0by calling\u00a0<span style=\"font-weight: bold\">InputHelper.assignKeyToButton(Key, buttonName). \u00a0<\/span>Want multiple keys assigned to the same virtual button? \u00a0No problem!! \u00a0By typing <strong>InputHelper.assignKeyToButton(&#8220;W&#8221;, &#8220;up&#8221;);<\/strong> and\u00a0<strong>InputHelper.assignKeyToButton(&#8220;Z&#8221;, &#8220;up&#8221;);<\/strong> both QWERTY and AZERTY keyboard users can both press up in the way they want. \u00a0Your game objects will be checking against the virtual button and won&#8217;t know the difference!!<\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\">Every game loop, call\u00a0<span style=\"font-weight: bold\">InputHelper.updateKeys()<\/span>.\u00a0\u00a0Once that is done, use\u00a0<span style=\"font-weight: bold\">InputHelper.isButtonPressed(buttonName)<\/span>\u00a0or one of the other functions in place of the FlxG.keys functions. \u00a0Done!<\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\">But that&#8217;s not all. \u00a0Download InputHelper in the next (Editor note: Insert days\u00a0to next Ludum Dare here) days and receive <strong>InputHelperMenuState\u00a0<em>absolutely free<\/em><\/strong>!!!<\/div>\n <div style=\"color: #606060\"><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/InputHelper.png\"><img class=\"alignnone size-medium wp-image-370096\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/InputHelper-300x113.png\" alt=\"InputHelper\" width=\"300\" height=\"113\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/InputHelper-300x113.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/InputHelper-550x208.png 550w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\">Just switch to the <strong>InputHelperMenuState<\/strong> in your HaxeFlixel game and give your users the ability to change their keymappings instantly with <b>no work on your part<\/b>. \u00a0InputHelperMenuState integrates seamlessly with InputHelper to allow users to click and reassign keys. \u00a0The screen is simple (and kind of ugly) but its free and you should stop complaining!<\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\">Get InputHelper <a title=\"here\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/103108185\/InputHelper\/InputHelper.hx\">here<\/a>.<\/div>\n <div style=\"color: #606060\">Get InputHelperMenuState <a title=\"here\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/103108185\/InputHelper\/InputHelperMenuState.hx\">here<\/a>.<\/div>\n <div style=\"color: #606060\">Get Readme <a title=\"here\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/103108185\/InputHelper\/readme.txt\">here<\/a>.<\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\"><\/div>\n <div style=\"color: #606060\">Want to try before you buy? \u00a0Download a quick .swf file demo <a title=\"here\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/103108185\/InputHelper\/inputHelper.swf\">here<\/a>.<\/div>","time":"August 20th, 2014 3:51 pm","title":"HaxeFlixel InputHelper"}