{"author_name":"colincapurso","cat":"October Challenge 2012","comments":[],"epoch":1351716060,"likes":2,"metadata":{"p_key":"51154","p_author":"colincapurso","p_authorkey":"7205","p_urlkey":"86847","p_title":"Panda7 game finished! 10 minutes over deadline.","p_cat":"October Challenge 2012","p_event":"LD24","p_time":"1351716060","p_likes":"2","p_comments":"0","p_status":"UPD5","us_key":"7205","us_name":"colincapurso","us_username":"colincapurso","event_start":"1345766400","event_key":"12","event_name":"LD24"},"text":"<style type='text\/css'>\n #gallery-1 {\n margin: auto;\n }\n #gallery-1 .gallery-item {\n float: left;\n margin-top: 10px;\n text-align: center;\n width: 50%;\n }\n #gallery-1 img {\n border: 2px solid #cfcfcf;\n }\n #gallery-1 .gallery-caption {\n margin-left: 0;\n }\n \/* see gallery_shortcode() in wp-includes\/media.php *\/\n <\/style>\n <div id='gallery-1' class='gallery galleryid-186873 gallery-columns-2 gallery-size-thumbnail'><dl class='gallery-item'>\n <dt class='gallery-icon portrait'>\n <a href='http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/10\/Screenshot480x854_0.png'><img width=\"150\" height=\"150\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/10\/Screenshot480x854_0-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"Screenshot480x854_0\" \/><\/a>\n <\/dt><\/dl><dl class='gallery-item'>\n <dt class='gallery-icon portrait'>\n <a href='http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/10\/Screenshot480x854_1.png'><img width=\"150\" height=\"150\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/10\/Screenshot480x854_1-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"Screenshot480x854_1\" \/><\/a>\n <\/dt><\/dl><br style=\"clear: both\" \/>\n <\/div>\n \n <p><a title=\"Panda7\" href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.handsomegoats.panda7\" target=\"_blank\"><strong>Panda7<\/strong><\/a>, my October challenge game is finally finished. Sort of.<\/p>\n <p>I started on 1st October and finished 10 minutes into the 1st of November.<\/p>\n <p>This is the first game\u00a0I&#8217;ve\u00a0completed and by completed I mean the first game I&#8217;ve gotten to a decent playable state.<\/p>\n <p><strong>On Development<\/strong><\/p>\n <div><strong>I feel like a Java pro.\u00a0<\/strong><\/div>\n <div><em>I learn best by going head first into the unknown and making mistakes\u00a0<\/em>and this game was full of mistakes.<\/div>\n <div><\/div>\n <div>I\u00a0started this project not \u00a0confident with Java. It was fun and painful learning the quirks and weirdness of Java.<\/div>\n <div><\/div>\n <div>Although similar, Java is not C#. C# makes life a lot easier.<\/div>\n <div><strong>So many code re-writes.<\/strong><\/div>\n <div><strong><\/strong>After writing hundreds of lines of code, my brain tells me,<\/div>\n <div><\/div>\n <div><em>&#8220;You know what,\u00a0I&#8217;m\u00a0only going to tell you after you&#8217;ve spent 10 hours on code, a better way to do the whole thing&#8221;.<\/em><\/div>\n <div><\/div>\n <div>This happened about twice a week and had me moving large chunks of code all over the place. Fortunately, I have a preference for re-writing things rather than fixing them, so this wasn&#8217;t too painful and I was used to things now working so no unusual problems there.<\/div>\n <div><\/div>\n <div>The biggest code re-writes were;<\/div>\n <div>\n <ul>\n <li>Splitting everything into <strong>Controller \/ Input \/ View<\/strong>.<\/li>\n <li>Moving all my <strong>sprite sheet slices<\/strong> and their destination rectangles into a single class. A class made up of nothing but static fields and methods.<\/li>\n <li><strong>Game Logic<\/strong> got re-written a few times. It finally found it&#8217;s home in a method that returns after each successful logic execution. Gave my game that staggered one after the other effect.<\/li>\n <li>Removing my event system. The game was too small for an event system and the game logic also doesn&#8217;t traditionally run like a normal game. It only executes bit of logic per update (my normal games execute all logic)<\/li>\n <\/ul>\n <\/div>\n <div><\/div>\n <div><strong>Android.. horrible Android<\/strong><\/div>\n <div>Fragmentation. I know that word gets thrown around a lot with regards to Android.<\/div>\n <div>Some things to know about Android<\/div>\n <div>\n <ul>\n <li>There are a gazillion different versions<\/li>\n <li>There are a gazillion different screen resolutions<\/li>\n <li>There are a gazillion different screen aspect ratios<\/li>\n <li>All 3 of these are common<\/li>\n <\/ul>\n <div><strong>Display<\/strong><\/div>\n <div>Originally I had coded the game to change all my screen elements to different sizes and different spacing depending on the size of the screen.<\/div>\n <div><\/div>\n <div>It worked, but it was messy. The code was messy (I was inconsistent) and the game screens were inconsistent. The last run of coding was re-doing the display system.<\/div>\n <div>Essentially all\u00a0I&#8217;ve\u00a0done is designed it for a 480&#215;800 screen and linearly scale it for different resolutions. It means it will look a bit silly for the more squarish screens with the extra space on the sides.<\/div>\n <div><\/div>\n <div><strong>Weird bugs and debugging<\/strong><\/div>\n <div>When I first started making the game for Android I had crashes all the time. I had no idea what caused them and no idea how to fix them. The\u00a0Internet\u00a0helped a little. The biggest help was my house mate giving me mini lessons memory address and stack traces (I hadn&#8217;t learnt about it \u00a0before in class, I am a still a current student after all). So thanks house mate for that. It made tracking down bugs a lot easier.<\/div>\n <div><\/div>\n <div>My game has HD and SD graphics. If your device is over 600px wide, the game will switch to HD mode. This was a problem in my emulator which only had 128Mb of RAM. I spent plenty of time fixing it, clearing memory and only loading images that needed it.<\/div>\n <div><\/div>\n <div>For some reason, Android 2.3.3 would constantly throw out of memory errors when loading HD Bitmaps.<\/div>\n <div><\/div>\n <div><strong>Bitmap<\/strong> objects have a method called<strong> .recycle()<\/strong>. A lifesaver.<\/div>\n <div><\/div>\n <div><strong>UI<\/strong><\/div>\n <div>I started coding a screen overlay, a menu with things like &#8220;Go to title screen, mute sound\/music, restart game&#8221;. Mid way through I remembered that Android has a menu button. That was incredibly easy to implement so I used that instead.<\/div>\n <div><\/div>\n <div>I ran into problems towards the end when I found out that later versions of android tablets don&#8217;t have menu buttons. It is still a problem I haven&#8217;t fixed yet. Not sure what to do.<\/div>\n <\/div>\n <div><\/div>\n <div><strong>Graphics<\/strong><\/div>\n <div>The easiest part of the whole process for me. I spent a couple of hours designing the game visually in Adobe Illustrator. The benefit of working in vector is I can just click on objects and I have the x,y,w,h coordinates immediately.<\/div>\n <div><\/div>\n <div><strong>Rects and Rectangles<\/strong><\/div>\n <div>The default class Android uses for rectangles is called Rects.<\/div>\n <div>A Rect rectangle is defined by left, top, right, bottom. I think it&#8217;s the same in pygame.<\/div>\n <div><\/div>\n <div>I <strong>hate<\/strong> it.<\/div>\n <div><\/div>\n <div>I wrote a new Rectangle class which defines a rectangle as x,y,w,h. The way god intended.<\/div>\n <div><\/div>\n <div>It ended up being a great idea, things got done a lot quicker and the code was tidier.<\/div>\n <div><\/div>\n <div>They did a couple of extra things, take in pretty much any data type in the constructor.<\/div>\n <div>They\u00a0remembered\u00a0their original size, which allowed me to have a absolute scale method. Very handy.<\/div>\n <div><\/div>\n <div><strong>Adventure Mode<\/strong><\/div>\n <div>Adventure mode was meant to be a main feature in my game and it&#8217;s the thing I wanted to add more than anything but time just didn&#8217;t allow for it.<\/div>\n <div><\/div>\n <div>Now that the game is done and it is mostly nice code, it&#8217;s doable. So if I have the time I&#8217;ll add that.<\/div>\n <div><\/div>\n <div><strong>Ads<\/strong><\/div>\n <div>My game is a free game. I needed to get some experience with monetization so to start with\u00a0I&#8217;ve\u00a0got advertisements. They&#8217;re horrible and ugly but\u00a0I&#8217;m\u00a0not going to make a dollar for the October challenge unless I have them.<\/div>\n <div><\/div>\n <div>They were quite a tricky to put in. I&#8217;m not\u00a0familiar\u00a0with Android and I learnt everything as I went along.<\/div>\n <div><\/div>\n <div>What I think I did was create my game view\/surface independent of the typical Android way and I believe the Ads needed the typical way.<\/div>\n <div><\/div>\n <div>I ended up creating a layout Java code, added my Game View and Ad View to that in code.<\/div>\n <div><\/div>\n <div>The ad supplier I used was AdMob by Google. Besides the above, it was a painless procedure.<\/div>\n <div><\/div>\n <div><strong>Publishing to Play Store<\/strong><\/div>\n <div>Incredibly simple process. I uploaded it at midnight and it didn&#8217;t appear on the store before I went to sleep. It was there in the morning so my guess is it takes about 4-8 hours to appear on the store.<\/div>\n <div><\/div>\n <div><strong>That&#8217;s it for now.<\/strong><\/div>\n <div>If you read the whole thing, thanks for reading.<\/div>\n <div><\/div>\n <div>Please \u00a0feel free to download it and leave positive feedback and click ads.<\/div>\n <div><\/div>\n <div>It&#8217;s here and it&#8217;s free https:\/\/play.google.com\/store\/apps\/details?id=com.handsomegoats.panda7<\/div>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/admob\/\" rel=\"tag\">admob<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ads\/\" rel=\"tag\">ads<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/android\/\" rel=\"tag\">android<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/app\/\" rel=\"tag\">app<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/coding\/\" rel=\"tag\">coding<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/free\/\" rel=\"tag\">free<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/game\/\" rel=\"tag\">game<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/gamedev\/\" rel=\"tag\">gamedev<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/google\/\" rel=\"tag\">Google<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/indie\/\" rel=\"tag\">indie<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/java\/\" rel=\"tag\">java<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ld\/\" rel=\"tag\">ld<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ludum-dare\/\" rel=\"tag\">Ludum Dare<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/october-challenge\/\" rel=\"tag\">october challenge<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/play\/\" rel=\"tag\">play<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/play-store\/\" rel=\"tag\">play store<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/post-mortem\/\" rel=\"tag\">post-mortem<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/store\/\" rel=\"tag\">store<\/a><\/p>","time":"October 31st, 2012 3:41 pm","title":"Panda7 game finished! 10 minutes over deadline."}