MPAGD kit
MPAGD SHMUPKIT
A Multi Platform Arcade Game Designer project for creating vertical shoot 'em ups, starting with the ZX Spectrum.
What is in it
- Player ship with left and right movement and upward thrust.
- Player missiles, fired with a key press.
- Enemies with movement patterns built from 16 directions.
- An enemy spawner that controls which enemies appear.
- A scrolling starfield in the main loop.
- Lives, a game-over message and a restart screen.
- Level and attack-wave progression.
- Key redefinition in the intro menu.
- A sprite counter and a documented set of global variables.
How the kit runs your game
Each frame follows the same path. Select an event to see what it does.
Start up
Every frame: the main loops
Every frame: each sprite
When the game ends
Game Initialisation
The L variable is used to keep track and progress the Levels/Attack Waves of the game, after the player successfully survives a Level it increments to the next on, so, naturally, we want to start at Level 1 (L=1)
Intro Menu
This is pretty standard MPAGD intro menu, but I've added the redefine keys commands, always let your player redefine their keys!
Initialise Sprite
The important thing here is that we include 'ADD 1 TO S' so that every sprite that gets initialised is added to the Sprite Counter (S) - we use this throughout Shmupkit to ensure we keep track of how many Sprites are currently on Screen, since MPAGD has a maximum of 12 sprites on screen at any one time, HOWEVER, I...
Main Loop 1
I've tried to keep the main loop as simple as possible, I've added a starfield travelling downward using the STAR DOWN command.
Player
The player event is quite straightforward. There are controls for left and right movement, thrust upward with the up key, this is restricted to half way up the screen but obviously you can change this.
Player Missile
The player Missile is defined in Spite Type 1. It uses a simple 16x16 sprite image, and is launched when the player presses the fire key.
Enemy Spawner
This is the engine room of Shmupkit. The Spawner itself is a blank sprite, and it's event controls which enemies should be spawned, where, how many and sets up all the parameters that control the enemy which are passed to the enemy event.
Enemy
Aliens perform a movement pattern which are a combination of directional movements, Direction 0-15, each one representing a point on a 16 point compass, and a number of repetitions.
Enemy Missile
Enemy missiles travel down the screen quite quickly, when they are spawned by an Enemy we pass the enemies direction of travel to the missile and then make the missile veer either left or right accordingly, so if the enemy was going left when they fired the missile then the missile will also veer left.
Kill Player
What happens when a player is killed?, we decrement their lives and update the lives counter on screen
Lost Game
A simple GAME OVER message, similar to the GET READY one in the Restart Screen Event:
Restart Screen
This event runs whenever the game first starts or restarts after the player is killed.
Global variables
The variables Shmupkit uses, with the free ones left for your game.
| A | Free for your own use |
|---|---|
| B | Free for your own use |
| C | Enemy colour |
| D | Kills to get bonus |
| E | # enemies in wave |
| F | Enemies left |
| G | Enemy release delay |
| H | Enemy weapon fire probability |
| I | X distance for enemy weapon triggering |
| J | Enemy sprite type |
| K | Enemy image |
| L | Level/wave |
| M | Player x for use in other events |
| N | Player y for use in other events |
| O | Free for your own use |
| P | Points for a kill |
| Q | Height for alien weapon release |
| R | Free for your own use |
| S | Sprite counter |
| T | Trigger |
| U | Free for your own use |
| V | Free for your own use |
| W | Enemy weapon |
| Z | Music (reserved) |
