Sign in to follow this  
Sivak

Doing level data for my shmup - Outline

Recommended Posts

Hey all. I kinda touched on this in the past, but I figured I'd bring it up again in more detail as I'm getting close to actually doing this part of the game. For levels, it pretty much will just be some very simple background scrolling and enemies coming in from somewhere and shooting at you, etc. The way I had considered doing this was using XML for the levels, though simple text could probably work too. Parsing might be a little annoying, but hopefully wouldn't be too bad. All I'd really be doing is spawning enemies and MAYBE have something in there for handling text boxes... I think I'd organize the events into some sort of list object and pop from the list (i.e. list would go last event to first event)... The way I'm thinking of going about doing this is having some sort of int counter going during the game (functioning as a timer if you will) and each frame it looks through the list. If an item matches the number, then that enemy would be spawned and the event to spawn it would be taken off the list. For things like mid-bosses, I'd pause the counter until you kill 'em. Does this sound reasonable? Thanks.

Share this post


Link to post
Share on other sites
Don't use frames as your counter, use time, as in milliseconds or seconds. Frames will vary from machine to machine.

The simple thing to do would be a text file which denotes when, what enemy (or object like weapon upgrades), and what initial data values (position, speed, etc.).

Load this into a list, and in your game loop, check the time, and compare with the time an object/enemy is supposed to be released, and move that object/enemy into the OnScreen list, and so on.

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