Sign in to follow this  
armond

Sidescroll Shooter - Loading Stages

Recommended Posts

Hehe hi guys. I'm here again to ask about common techniques about sidescrolling shooters. As for now, I still have this text file which I plan to use to load my map. The simplest thing I could do would probably be something like stage1.txt stage2.txt stage3.txt and so on... I also plan to create a separate map file(i.e. text file) for enemies. But I wonder, how am I suppose to implement a "continue" feature in case for example, the player dies(not literally)? I need to resume which part of the map or at least the closest part of the map the player should start and also, I have to revive some enemies at that portion of the map. I was thinking like having different scenes and separate text file for each like stage1_1.txt stage1_2.txt stage1_3.txt but this just seems very unelegant. You guys have any idea? Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by armond
in case for example, the player dies(not literally)

This has just made my day, thank you.

I am also interested in an answer. My solution is simply checkpoints.. when a player comes close enough to a coordinate in the level, specified in the level map, a variable is stored temporarily such as "playerRespawnX = whatever, playerRespawnY = whatever" etc. for use when the player respawns and the level is reloaded, but is not saved for future play sessions.

Share this post


Link to post
Share on other sites
Thank you for your answer.

Quote:
This has just made my day, thank you.


I didn't want to be misunderstood. :)

I got your point. But assuming there's an AI installed in my Enemy object, and this AI happen to move up and down then I probably wouldn't have an absolute(exact) position as it did when the player last dies then? It wouldn't matter much though... I guess. More ideas are still welcome. :)

Share this post


Link to post
Share on other sites
Some games, especially older ones, don't care about this at all: every time you revisit a certain area's, all enemies are alive again. However, that's probably not the approach you want to take. :)

I'd say, once the player reaches a savespot, remember the relevant data at that point: store which enemies are still alive and what locations/states they were in at that moment, and every other important piece of data. Exclude trivial things like which way a grass sprite was waving in the wind, for example, to make things easier. Whenever the player needs to restore his game, simply read in this information and reset the various game objects to these states. Whether you do this by reloading the map and then applying this data, or by applying this data from the moment the player died, is up to you. This is also the way most savegame systems work.

Share this post


Link to post
Share on other sites
A lot of things are starting to popup in my mind right now. Thank you for your answers guys! Still open for more suggestions though. But I'm quite satisfied. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this