Sidescroll Shooter - Loading Stages

Started by
4 comments, last by Kornomania 17 years, 5 months ago
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!
We should never stop learning...
Advertisement
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.
when you do something right, people won't be sure you've done anything at all.
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. :)
We should never stop learning...
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.
Create-ivity - a game development blog Mouseover for more information.
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. :)
We should never stop learning...
Hi!
You might want to take a look at binary file I/O for the map files. That helped me a lot.
Well, good luck with your game!

This topic is closed to new replies.

Advertisement