I'm venturing into Mobile/Tablet based development coming from the world of Web Applications.

I want to write a game similar to 1942/43 video game from the 80's: enter image description here

...similar in the sense that I have a plane/spaceship that flies vertically "up" the screen and stuff comes down to attack it (otherwise nothing that would violate copyright).

I'm familiar with collision detection, sprites, object pooling, etc. but what I'm spinning my wheels on is how to layout all the code for this game. e.g. it doesn't fit my normal MVC pattern, I don't have a DB, and the user input will likely be limited to touch based movement around the screen with "auto-fire" on all the time.

What I'm blanking out on is how to do all the "levels" and sequence "waves" of attackers within a level.

Should I just have a "level" file for each level, that queue's up attack waves? if so, based on time? based on some event? based on a position passed by the player?


<level id="1">
  <event timeoffset="500" type="attack" name="vConfiguration" position="50"/>
  <event timeoffset="1250" type="attack" name="jConfiguration" position="75"/>
  <event timeoffset="1300" type="bonus" name="quadGunUpgrade" position="10"/>

Part of me thinks this would be really easy to setup levels this way, then read in the file to queue up the events for the attacks/bonus/? to occur (where each named "attack" is a bit of configured code to position "N" enemies and start their flight sequences)

The other part of me thinks - whoa! before you even dream of implementing this - determine how others would approach it - no need to re-invent the wheel or create a monster.

  • \$\begingroup\$ Not quite the same, that other question presumes that this question is answered and is curious about the best way to use such an engine while this question is more about whether such an organization is even viable for what he wants to do. Plus, Frank is totally new to game loops and the flow is hugely different from web work so simpler answers should be expected. \$\endgroup\$ Commented Aug 21, 2011 at 20:06
  • \$\begingroup\$ Oh, OK.. I see.. \$\endgroup\$
    – pek
    Commented Aug 21, 2011 at 20:11
  • 2
    \$\begingroup\$ asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html can trivially generate 1943-style waves and barrages, if you're rather have a pre-made playback engine. \$\endgroup\$
    – user744
    Commented Aug 21, 2011 at 20:51

1 Answer 1


That is, in fact, how many old arcade games were created. Not the XML part of course, but the game is actually a playback engine that eats timed events that are simply a static data listing like what you have above.

All of the triggers you mention would be valid: time is the most common because it puts pressure on the player; events like "destroyed the wall" are used a lot; and position triggers, too. Other events like "specific enemy killed" can be used to build boss sequences, etc...

All just from reading data from a table and playing them back in the engine. It makes for compact code and fits in tiny memory spaces.

You're on a proven track with this design.

  • \$\begingroup\$ this is great! I wasn't sure if I was trying to get too fancy by building a "playback engine" type thing if there was an easier/more standard way to do this. I guess I've got some coding to do! \$\endgroup\$
    – Frank
    Commented Aug 21, 2011 at 20:34
  • \$\begingroup\$ Building that engine is a whole other ball of wax =) Keep with the "you're not going to need it" philosophy and keep it simple, only adding parts when you really do need them. In this way you'll be building a game instead of wasting all your time building an engine with no game to go into it =P \$\endgroup\$ Commented Aug 21, 2011 at 22:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .