Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Need help of multi-level 2D game developing

This topic is 6785 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m building a game whose world has many levels. Map of each level has the same height. Levels are linked by stairs and walls. My question is: what data structure is best suitable in this situation? Thank for your suggestion :-)

Share this post

Link to post
Share on other sites
This is probably a 2D game right?
If it''s all the same height, and the only linkages are at stairs then
1) in the area set an trigger/event(if player traverses this area) or a filename tag. Save the current level with any list of objects on it and then load the linked map with all its objects(swap in the levels)

2) don''t understand what you meant by "Levels are linked by...walls.

3) I usually use an array of pointers for my tilemap
struct tileinfo
int xpos, ypos;
Actor* UnitHere;
int TileNumber;
int AlphaTileNumber;
int BackgroundTileNumber;
} *CurrentMap[MAXROWS][MAXCOLS];

When you load it you just malloc a tileinfo struct for each tile.

If it''s 3D, then save oldinfo and load newinfo after a triggered event.

Developing a 2D RPG with skills, weapons, and adventure.
See my character editor, Tile editor, diary, 3D Art resources at
Check out my web-site

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!