{"id":1055,"date":"2013-02-18T21:52:54","date_gmt":"2013-02-18T20:52:54","guid":{"rendered":"http:\/\/mehm.net\/blog\/?p=1055"},"modified":"2013-08-21T21:27:42","modified_gmt":"2013-08-21T20:27:42","slug":"breakoutpong-project-setup","status":"publish","type":"post","link":"https:\/\/mehm.net\/blog\/?p=1055","title":{"rendered":"Breakout\/Pong Project &#8211; Setup"},"content":{"rendered":"<p>While I&#8217;m working on the game design for the <a href=\"http:\/\/mehm.net\/blog\/?p=1041\">Breakout\/Pong hybrid<\/a> in Unity, I&#8217;m starting to set up the development for HTML 5. I have to admit, a lot has changed since I last had a look in this sector. When I was looking for the last time, there were the first fledgeling HTML 5 game engines. Now, if you search for the term, you get dozens of engines!<\/p>\n<p>But, as I want the pure, intense and gritty experience of doing everything by hand, I&#8217;m going to skip all that and do it myself! Maybe a general-purpose javascript library if the language itself gets too confined, but apart from that, I&#8217;m on my own.<\/p>\n<p><strong>IDE<\/strong><\/p>\n<p>I&#8217;ve had a cursory glance at IDEs for javascript, and I&#8217;ve decided to go for <a href=\"http:\/\/brackets.io\/\">Brackets<\/a>. Notably, it doesn&#8217;t have autocompletion for javascript, but since the purpose of this whole exercise is to learn it better, I think it&#8217;s not necessarily a bad idea to live without it. This way, you actually have to learn the API and not glance at what your IDE suggests you use.<\/p>\n<p><strong>First steps<\/strong><\/p>\n<p>I was following <a href=\"http:\/\/html5.litten.com\/moving-shapes-on-the-html5-canvas-with-the-keyboard\/\">this tutorial<\/a> on\u00c2\u00a0James Litten&#8217;s blog for getting the keyboard inputs in HTML 5 and got a super basic website going that logs what key you have pressed. It&#8217;s certainly not rocket science, but it&#8217;s one of the foundations for game development :-)<\/p>\n<p>The next step was to put this code into a nice class that goes into a separate file. No huge, hundred-classes-in-one-file web page for me, thank you. Currently I&#8217;ve got the paddle controls and the ball physics implemented, after which will be the Breakout bricks. The whole things still has a really classic Pong look (black and white shapes), nice sprites and animations will be added later on.<\/p>\n<p><strong>Reading<\/strong><\/p>\n<p>Playing the first prototype got me interested in the game mechanics of Breakout. A search found me <a href=\"http:\/\/www.gamasutra.com\/view\/feature\/130053\/breaking_down_breakout_system_and_.php\">this gem<\/a> on Gamasutra by Mark Nelson which I&#8217;ve been reading. One major insight is that a Breakout-style game really benefits from a level editor to create interesting levels. Which is why I&#8217;ve expanded a bit on the web-based game idea and am currently also working on an editing mode to have the level editor also web-based. For this goal I&#8217;m also going into PHP for the server-side code for storing levels in a database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While I&#8217;m working on the game design for the Breakout\/Pong hybrid in Unity, I&#8217;m starting to set up the development for HTML 5. I have to admit, a lot has changed since I last had a look in this sector. When I was looking for the last time, there were the first fledgeling HTML 5 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,3],"tags":[94,95,96,97,93],"_links":{"self":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1055"}],"collection":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1055"}],"version-history":[{"count":7,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions"}],"predecessor-version":[{"id":1063,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1055\/revisions\/1063"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=\/wp\/v2\/media\/1174"}],"wp:attachment":[{"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mehm.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}