{"author_name":"TFernando","cat":"LD #17 - Islands - 2010","comments":[],"epoch":1272153540,"likes":0,"metadata":{"p_key":"70981","p_author":"TFernando","p_authorkey":"1164","p_urlkey":"106802","p_title":"Pan and Zoom","p_cat":"LD #17 - Islands - 2010","p_event":"LD17","p_time":"1272153540","p_likes":"0","p_comments":"0","p_status":"UPD5","us_key":"1164","us_name":"TFernando","us_username":"tfernando","event_start":"1271980800","event_key":"3","event_name":"LD17"},"text":"<p>For some reason, I just wasn&#8217;t able to get a good start yesterday. Starting to catch up now I think.<\/p>\n <p><a href=\"http:\/\/nightflyergames.com\/games\/LD17\/\">Click here<\/a> for my in-progress builds (Requires Flash Player)<\/p>\n <p>Sticking the rest of this behind a read-more tag, since there&#8217;s a bunch of images.<br \/>\n <span id=\"more-18194\"><\/span><\/p>\n <p>So&#8230; the general idea of my game is that there&#8217;s a group of <strong>islands<\/strong>, populated by an endangered animal (currently, a striped kiwi). An invasive species (not yet finally named) has arrived, and the player&#8217;s job is to eradicate the invader.<\/p>\n <p>No idea why it&#8217;s a kiwi. I drew it and the invader last night before falling asleep. I probably need to re-draw both.<\/p>\n <p><img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/glomper.png\" alt=\"glomper\" width=\"32\" height=\"32\" class=\"alignleft size-full wp-image-18210\" \/><img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/kiwi.png\" alt=\"kiwi\" width=\"32\" height=\"32\" class=\"alignright size-full wp-image-18209\" \/><\/p>\n <p>The basic rules- untested as of yet.. are<br \/>\n &#8211; The player can place traps, and walls.<br \/>\n &#8211; Traps will kill any animal that steps on them (good or bad)<br \/>\n &#8211; Walls will permit movement of the kiwis, but not the invaders<br \/>\n &#8211; Player gets resource points every second which he\/she spends on the traps\/walls<br \/>\n &#8211; Animals can walk on shallow water, but not deep water<\/p>\n <p>Anyway, to explore the ruleset, I need to be able to visualize what&#8217;s going on. So, thus far I&#8217;ve been working on getting a map working. Much as I&#8217;d love to have procedurally generated islands, I could see spending all of the remaining time trying to get an algorithm to work. So I just free-hand(ish) drew some:<br \/>\n <img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/tilemap.png\" alt=\"tilemap\" width=\"500\" height=\"480\" class=\"aligncenter size-full wp-image-18215\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/tilemap-300x288.png 300w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/tilemap.png 500w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n <p>I say free-handish, because I used the path and stroke tools in Gimp, to draw the islands, and then went back over the image with a pencil tool to ensure that the image only had 4 colors in it. More on that in a sec&#8230;<\/p>\n <p>Now, I figured that map was too ugly to display to the player, so I screwed around with various filters and effects (mostly creating noise, and then using that noise as a bump map) to get a (slightly) more aesthetically pleasing map for player use.<\/p>\n <p><img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/prettymap-550x558.png\" alt=\"prettymap\" width=\"550\" height=\"558\" class=\"aligncenter size-large wp-image-18218\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/prettymap-550x558.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/prettymap.png 583w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/p>\n <p>(I&#8217;ll admit to having the artistic ability of a year old turnip, but I like this map a little better) Now I have a scale problem&#8230; my island fauna are tentatively 32&#215;32 sprites, which would be too large for my islands. I need at least one, and probably more levels of zoom, right?<\/p>\n <p>Going back to the original 4-color map, I read that map in pixel by pixel using getPixel32(). The returned color sets each tile&#8217;s type (Sand, Jungle, Deep Water, etc), which is stored in a 2d map array. When the map array is created, it also generates a random offset for that tile, which is used to pick a rectangle out of a base tile to represent the terrain. This, for example, provides 50, 20&#215;20 Deep Water tiles:<br \/>\n <img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/Deep25.png\" alt=\"Deep25\" width=\"70\" height=\"20\" class=\"aligncenter size-full wp-image-18222\" \/><\/p>\n <p>This seems to work adaquately, though as you can see, I need to lighten some of the darker pixels in my first level of zoom:<\/p>\n <p><img src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2010\/04\/v01FiveZoom.png\" alt=\"v01FiveZoom\" width=\"336\" height=\"243\" class=\"aligncenter size-full wp-image-18223\" \/><\/p>\n <p>However, at this point I&#8217;ve spent way too much time on aesthetics (and explaining(!!)) so it&#8217;s time to get to populate my islands and get some dynamics working!<\/p>\n <p>-TF<\/p>","time":"April 24th, 2010 6:59 pm","title":"Pan and Zoom"}