Zelda3 type map - which layers do I need?
I am making a map editor for my first game ever (great way to start)
Have you ever played Zelda3 on the Snes? It has 1 bottom layer with 16x16 tiles (flowers, grass, bushes, rocks, collision with player/enemies)
1 layer with 8x16 or 8x8 tiles (fences, roof of buildings and other things.. it also detects collision in 8x8)
How would I replicate this and not loose to much speed when
checking for collition on both the 1st layer & the 2nd?
Currently I have: (Delphi code)
TBackgroundTile = Record
Image : Byte;
Blocking : Byte;
Animated : Byte;
// animates 3 images if greater than 0
End;
TForegroundTile = Record
Image : Byte; // 0 for transparent
Blocking : Byte;
Transparent : Byte; // is image transparent?
Animated : Byte;
Flag : Byte; // special
End;
Layer0 = Array[0..63,0..63] of TBackgroundTile;
Layer1 = Array[0..127,0..127] of TForegroundTile;
Btw: is this the easiest way to make a map? If player walks around on the map, and bumps into a bush... he would cut it down with his sword and then walk over it.
Should I just change the Image & Blocking properties of the tile?
Could anyone give me an answer?
Oogly!;>
Each of my MapSquares contains a reference to the type of tile it contains. Therefore, the MapSquare at 30,20 might have a reference to the ''Bush'' terraintype, indicating that it contains a bush. If you attack any MapSquare containing a Bush, it could change that MapSquare to instead refer to a ''Ground'' terraintype. I don''t actually change the image and properties of the MapSquare, I just make it so that MapSquare now is a different type of square. Do you follow?
Alternatively, make bushes and the like as immobile objects that simply sit on top of a grass or earth tile. Then, you can easily have neat tricks like stacking bushes on top of other objects, so that you can hack through to find something. Another advantage is that you don''t have to write separate routines for a hacked bush that turns to grass, a hacked bush that turns to earth, etc etc.
Alternatively, make bushes and the like as immobile objects that simply sit on top of a grass or earth tile. Then, you can easily have neat tricks like stacking bushes on top of other objects, so that you can hack through to find something. Another advantage is that you don''t have to write separate routines for a hacked bush that turns to grass, a hacked bush that turns to earth, etc etc.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement