Jason’s babblings.

More awesome than a ten pound bag of flapjacks.

Day 3: Let’s make the map larger.

Posted by Plaidman on March 29th, 2010

Please note for today’s writeup, all coordinates assume the very top-left is 0/0, increasing X as you go right and increasing Y as you go down. Also when I say map location, I mean the location on the entire map, grid or ‘visible map’ means the visible portion of the map on the screen, and pixel is each little dot on the screen. Now that we have that cleared up for the less technically savvy, on with the show.

Yesterday, we left the game drawing a subset of the map and Red traveling around the subset. Today We’ll make it so Red can travel around the entire map. To do this, we’ll need to come up with a way to represent movement around the whole map.

We could keep the visible portion on the same section of the map no matter what – even if Red is not on a visible tile. This is just silly, and I’m disappointed you would even suggest it.

Another option is to keep the view stationary until Red reaches the edge of the map, then adjust the visible portion of the map so we can still see where Red is going. This is better, but it still leaves some surprises if there’s an angry killer bunny right next to us on the next screen that we didn’t see (this is one of the things that bugged me about old Zelda games).

Yet another option is to keep Red in the center of the screen at all times, and move the grid around him. Essentially, adjust the visible portion of the map whenever Red moves to a new tile, so you always see the same range of tiles no matter where you are on the map. This is the method I’m going to use for this game.

This change will require another major overhaul to the drawing routine to figure out exactly how to choose which map tile to start drawing in the upper left, and how to nudge the map so Red appears in the middle of a tile (instead of standing between two tiles). I won’t go into details here to keep things simple, but you can ask if you want details.

Current demo: Red stays stationary in the middle of the screen and the grid is drawn around him. As Red moves, the grid is adjusted so you always see the same range of tiles around Red at all times.

One Response to “Day 3: Let’s make the map larger.”

  1. Adriannnnnnnn Says:

    Fortunately, I too am a nerd, and this seems relatively exciting. Good to see you’re making progress, and hope to see it done in the near future. Good luck cutie :D