Wednesday, December 14, 2011

Maps...

Ugh... how am I gonna do the game maps.

In the past, when I've needed a map for a tile game, I just create a 2d array, and there you go.  Fill the array with tile objects.  Now though, with this entity system, things are different.  For one, all entities already have coordinates, so there's no need for a map array.  Although having one could make looping through just the map tiles easier.  Plus if map tiles are just another entity... and this is a 2d game, I've got to separate layers.. like what's passable and what's not, what gets drawn on top.  I don't want to necessarily say that just because something is terrain it's on the bottom layer.  There will be other entities laying about, and they all need layer information too.  No reason to create a special case just for terrain.

Another thought I had was... what is the coordinate system even based off of?  Is the whole world just the size of the screen?  Should it be infinite?  If so, how do you work out the offset for coordinates.  Maybe the game should run old school zelda style, where if you walk off the edge of the screen, another map slides into view.

Ah.... interesting thought.  So, what if... You have a map aspect/entity that represents one screen full of information.  Then tiles, monsters, whatever can have their x,y grid relative to the map they are associated with.  Then the map has the names or ids of the four other maps that are adjacent to it.  Then you can have infinite maps without coordinates.  Oh six maps, I guess.  For above and below as well.  Hmm.. another thought.  This wouldn't even have to be screen sized maps either.  They could be anything.  256x256, 16x16, whatever.  It would just be a way of chunking up the map.

Alright, so, big question.  Are we doing the Zelda style maps that flip when you reach the edge, or smooth scrolling to infinite distance...

You know, it would be a lot easier to do the zelda style.. but more fun to have the infinite scrolling style.  But much harder..

No comments:

Post a Comment