Home | Rules and Guide | Sign In/Create Account | Write a Post | Donate | #ludumdare on irc.afternet.org (Info)

Ludum Dare 23 — April 20th-23rd, 2012 — 10 Year Anniversary!

Ludum Dare 22 :: December 16th-19th, 2011 :: Theme: Alone

[ Results: Top 50 Compo, Jam | Top 25 Categories | View My Entry ]

[ View All (Compo, Jam) | Warmup ]


Pan and Zoom

Posted by
April 24th, 2010 6:59 pm

For some reason, I just wasn’t able to get a good start yesterday. Starting to catch up now I think.

Click here for my in-progress builds (Requires Flash Player)

Sticking the rest of this behind a read-more tag, since there’s a bunch of images.

So… the general idea of my game is that there’s a group of islands, populated by an endangered animal (currently, a striped kiwi). An invasive species (not yet finally named) has arrived, and the player’s job is to eradicate the invader.

No idea why it’s a kiwi. I drew it and the invader last night before falling asleep. I probably need to re-draw both.

glomperkiwi

The basic rules- untested as of yet.. are
- The player can place traps, and walls.
- Traps will kill any animal that steps on them (good or bad)
- Walls will permit movement of the kiwis, but not the invaders
- Player gets resource points every second which he/she spends on the traps/walls
- Animals can walk on shallow water, but not deep water

Anyway, to explore the ruleset, I need to be able to visualize what’s going on. So, thus far I’ve been working on getting a map working. Much as I’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:
tilemap

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…

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.

prettymap

(I’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… my island fauna are tentatively 32×32 sprites, which would be too large for my islands. I need at least one, and probably more levels of zoom, right?

Going back to the original 4-color map, I read that map in pixel by pixel using getPixel32(). The returned color sets each tile’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×20 Deep Water tiles:
Deep25

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:

v01FiveZoom

However, at this point I’ve spent way too much time on aesthetics (and explaining(!!)) so it’s time to get to populate my islands and get some dynamics working!

-TF

Leave a Reply

You must be logged in to post a comment.


All posts, images, and comments are owned by their creators.

[fcache: storing page]