top of page
  • Writer's pictureBruce

Vertical Shmup - Part 10 - A spot of housekeeping

Now that we've got most of the basics of the game working, let's take a break and tidy up the presentation of the game a bit.


First let's add an intro menu:


MENU: EVENTS > INTRO MENU



EVENT INTROMENU

WAITKEY
BORDER 0                    ; black border
COLOUR 68                   ; green text on black
CLS                         ; clear the screen   
LET CONTROL = 99
WHILE CONTROL >= 99
	PRINTMODE 1
	AT 4 7
	PRINT "RETURN TO ARCADIA"
	PRINTMODE 0
    AT 8 10
    PRINT "1. KEYBOARD"
    AT 10 10
    PRINT "2. KEMPSTON"
    AT 12 10
    PRINT "3. SINCLAIR"
    AT 14 10
    PRINT "4. REDEFINE"
    LET CONTROL = 99
    WHILE CONTROL = 99
        IF KEY OPTION1
            LET CONTROL = 0
        ENDIF
        IF KEY OPTION2
            LET CONTROL = 1
        ENDIF
        IF KEY OPTION3
            LET CONTROL = 2
        ENDIF
        IF KEY OPTION4
		CLS
		WHILE KEY OPTION4
        ENDWHILE
        AT 7 12
		PRINT "PRESS KEY FOR:"
		AT 9 12
		PRINT "LEFT"     
		DEFINEKEY LEFT	; the key pressed will be the new LEFT key
		AT 11 12        
		PRINT "RIGHT"     
		DEFINEKEY RIGHT	; the key pressed will be the new RIGHT key
		AT 13 12
		PRINT "THRUST"
		DEFINEKEY UP		; the key pressed will be the new THRUST key
		AT 15 12
		PRINT "FIRE"
		DEFINEKEY FIRE1	; the key pressed will be the new FIRE key
		AT 17 12
		PRINT "PAUSE"
		DEFINEKEY FIRE3	; this will be the PAUSE key
		LET CONTROL = 100 
		CLS
        ENDIF
    ENDWHILE
ENDWHILE
CLS

Next, we'll tidy up the Game Initialisation event:


MENU: EVENTS > Game Initialisation:



EVENT GAMEINIT

LET L = 1			; Level (starts at 1)

LET LIVES = 3	
AT 0 14
DISPLAY LIVES

AT 0 1
SHOWSCORE

AT 0 25
SHOWHIGH


Now lets add a 'Get Ready message to the screen every time the player starts (including after being killed if they still have lives left:



EVENT RESTARTSCREEN

LET S = 0			; initialise the sprite counter
AT 0 1				; position the cursor Line 0 Column 1
SHOWSCORE			; display the score

AT 10 12			     ; Cursor at L10 C2
REPEAT 10			; do this 10 times
READ A				; read next item into A
CHR A				; Display A
DELAY 5				; short wait
ENDREPEAT			; all items displayed?
DELAY 100			; longer wait


DATA 'G' 'E' 'T' ' ' 'R' 'E' 'A' 'D' 'Y' '!'






Next, the Kill Player event:

MENU: EVENTS > KILL PLAYER



EVENT KILLPLAYER

SUBTRACT 1 FROM LIVES	; reduce number of lives remaining
AT 0 16					; update the lives in the score bar
DISPLAY LIVES
CLW						; clear the play area

And finally, for now, the Lost Game event:


MENU: EVENTS > LOST GAME



EVENT LOSTGAME


AT 10 12			    ; Cursor at L10 C2
REPEAT 10			; do this 10 times
READ A				; read next item into A
CHR A				; Display A
DELAY 5				; short wait
ENDREPEAT			; all items displayed?
DELAY 100			; longer wait


DATA 'G' 'A' 'M' 'E' ' ' 'O' 'V' 'E' 'R' '!'

And for a touch of visual flourish, we ll add a starfield to the play area, add this line in to your Main Loop 1 event:


STAR DOWN		; vertical star field


I'm also going to select a new font.


Now lets test it:




And there you go, if you have reached this point you should have a small, but fully functioning, vertical shoot 'em up! My version is currently using just under 13Kb of memory, so we have plenty left to play with. At some point we're going to want to add some sound, maybe add some powerups, but next I want to improve the Alien sprite so that it points in the right direction that it is travelling.





29 views0 comments

Recent Posts

See All

Vertical Shmup - Part 1 - Introduction

A couple of people have asked for some tutorials on creating a Vertical Shoot-em up with MPAGD, something along the lines of Imagine's classic, Arcadia. This sounded like a good challenge....but one I

Want to support my work?....Buy my games!

aboutME

Hello, I'm Bruce and I write games for old 8bit computers using Jonathan Cauldwell's excellent Multi-Platform Arcade Games Designer (MPAGD)

I've written a few successful* games for the Sinclair ZX Spectrum and MSX platforms that have been (largely) well received including Twenty Four Hour Parsley People scoring a 10 out of 10 on Planeta Sinclair.

In my blog I am sharing lots of the code that I wrote for my games, in a way that you can use in your own games.   I've commented it so that you'll learn some of the techniques I use to create interesting new mechanics and help your games stand out from the pack.

MPAGD includes lots of standard scripts, they're great to get you started, but if you're new (or just rusty) when it comes to writing code, hopefully my tutorials will help you get started and  turn your imagination into awesome 8 bit games!

All my code is free to use and do with as you please, but if you find them useful please feel free to buy me a coffee ...or better still - buy or download my games :)

*successful is a very relative term in 8bit computer games

bottom of page