Talk:Village/@comment-13406752-20130801024052/@comment-9531161-20130802203953

Well I finally got a chance to look at your program, and it looks like you've made a lot of progress (it's quite a bit different than the sample). However, what you're asking me to do is write a large chunk of code for you. It's not that it's going to take too much time, it's just that I don't believe that's any way to learn programming. I can give you ideas, but if you don't come up with the code yourself, you won't be able to do it again when it pops up in another game you want to make.

For levels: I'd keep track of how many enemies are on the screen. Each time you shoot one down, subtract 1 from that number. When it reaches 0, you can tell the game to go to the next level. You could have a variable that indicates what level you're on, and base certain game aspects off of it. For instance, when you're moving the enemies, you could have a line that does something like:

IF (LEVEL >= 2) THEN GOSUB @ENEMYFIRE

Then you can write an ENEMYFIRE function that shoots things at you. You can reuse parts of the code for the player's fire for the enemy fire, but remember to use different variables so they can both be on the screen at the same time (otherwise you couldn't shoot while the enemies are shooting).

For the timer, you might be doing something like WAIT 60 or something. Instead, keep a counter that gets added to each frame. If your game is running at 60 frames per second, that number will reach 60 at the first second. Then you can reset this counter back to 0 when it reaches 60 and keep track of how many times this happens. This is the amount of elapsed seconds in your game, and you can display this up at the top or something.