I've tried to keep the main loop as simple as possible, I've added a starfield travelling downward using the STAR DOWN command.
Also, I am using T as a 'Trigger' variable, at the moment I'm just using it to trigger updating the score - there's a fuller explanation here:
In most of my games I tend to have a variable used for this purpose, I don't like refreshing scores etc. in every cycle through the program, rather I only want to update the on-screen scores when I need to, and rather than adding 'showscore' in all the events that the score changes, I just use one, wrapped inside a simple IF ... ENDIF and then Trigger it by letting T = 1 in other events.
You can, of course, use this Trigger variable T for other purposes as well in your game, just remember to reset it to 0 when you are done with it.
EVENT MAINLOOP1
STAR DOWN ; starfield travelling down
IF T = 1 ; Score bar update requested
AT 0 1 ; at Line 0 column 1
SHOWSCORE ; update the score
LET T = 0 ; reset the trigger
ENDIF
IF KEY FIRE3 ; Pause the game if pause key is pressed
WHILE KEY FIRE3
ENDWHILE
WAITKEY
ENDIF
Comments