In this game you control a plane flying over a sea. You encounter an increasing number of enemy planes that try to destroy you. You should avoid these or shoot them. The goal is to stay alive as long as you can and to destroy as many enemy planes as you can.
The background is formed by a scrolling sea with some islands. The player’s plane flies over this sea. You can shoot bullets that destroy enemy planes. There are four types of enemy planes: a plane that you encounter and should be destroyed, a plane that fires bullets downwards, a plane that fires bullets towards the player’s plane, and a fast enemy plane that comes from behind rather than from the front.
There are some explosion sounds and there is some background music.
The player controls the game with the arrow keys. With the space key you fire a bullet. Only one bullet can be fired every five steps.
The player immediately jumps into the game. The player has three lives. When all lives are gone a high-score table is shown. Pressing the <F1> (help) key will give a brief explanation. Pressing the <Esc> key will end the game.
There is just one level, but more and more enemy planes will arrive: first only the easy type but later the more difficult types
As our game takes place over the see we need a background image that looks like a see viewed from above. Add the following small image as a background resource to the game and give it the name bkg_water:
To create a room with a moving background, add a room to the game in the familiar way. At the left click on the tab labeled backgrounds. We need to change three settings here.
The form should now look as follows:
Create three sprites island images (with transparent background):
Uncheck the box Precise collision checking since we will not be checking for collisions.
of the islands we create an object.
When the island disappears below the bottom of the room we want to make it reappear at the top.We can use the built in feature of room_height a to do this.
To move to the top of the room we use the action to jump to a position. We want to jump to a random position above the room, not a particular one. In the jump action we use random(room_width) as the x-coordinate. This will create a random value between 0 and the width of the room. So the jump action will look as follows:
The Main Plane
Add the enemy planes. They simply fly down.(I know ..... boring, we will make it more complicated later)
Create - set the vertical speed
Outside Room - respawn random.
add collision events for the enemy plane:collision event with the main plane which should destroy the main plane and end the game.
Let us start with the canon. We need a bullet sprite. To make it a bit spectacular we use a rather large bullet. Exaggerating things is often important in games. Make sure to set the origin to center.
On the Plane add the Space key and create a bullet
On create of the bullet - set the verticle speed of the bullet
On Outside Room of the bullet - destroy the instance so the bullets do not continue to fly outside the room.
Wow ....... way to many bullets. We need to slow things down
We will only allow the player to fire bullets every second, that is, one bullet every 15 steps.
To achieve this we create our own variable called can_shoot.
In the create of the plane set can_shoot to 1, indicating that we can indeed shoot a bullet.
And add an Alarm to determine when we can shoot.
On the space key event we test whether the variable can_shoot is equal to 1.
In Alarm 0 - set can_shoot = 1, indicating that we can shoot again.
You can change the alarm to change the shooting speed.
Collision Event with the Bullet
Add sound, destroy the enemy, play an explosion, re-spawn enemy at the top of the screen at a random location and set the score.
Collision with the Main Plane
Again we will need an explosion sprite (a bit bigger this time) and an exploding sound (a bit louder this time).
In the explosion Animation end event we do a few things. Destroy the instance to make it invisible. Sleep a while to make sure that the exploding sound is finished. Show the high-score list. Finally restart the game. So the event looks like this:
In the collision event of the enemy plane and the main plane, change the main plane, that is, the other instance, into an explosion. Also we play the exploding sound and we destroy the enemy plane.
planes as the game continues. (Just like we did with the bombs in
Create an controller_enemy object
Place one instance of the controller object in the room.
Scores, Lives, and Damage
To make the game a bit more interesting we will let enemies create damage. Only when the plane gets too much damage will it be destroyed. Also we will introduce multiple lives and create a nice information panel that shows this information, together with the score.
To create all this we make a new object called the controller_life. It does not need a sprite.
In the create event sets the score to 0, the number of lives to 3, and the health to 100.
Drawing the Information Bar
It will show the score, the damage (in the black area at the left), and the number of planes left, that is the number of lives.
In the draw event of the controller_life
- draw the panel sprite at the bottom
To make sure that the bottom panel lies above everything else we give the controller_life object a depth of –10000.
The health is displayed in the form of a health bar. You can indicate the position, size, and color scheme used as follows:
The controller_life object will check when the health becomes smaller than 0. There is an event for this under the other events. In this event we blow up the main plane by turning it into a big explosion. We also reset the health and play the correct sound. So the event looks like this:
Modify the Explosion to subtract a life
Add a No More Lives
object to Restart
Adding Shooting Enemies
New Enemy 2 - Shooting Straight Down
Duplicate obj_enemy2 and modify
Create a Controller_Enemy
In the creation event we set alarm 1 to a value of 1000.
In Alarm1 we create
New Enemy 3 - Shooting towards the Main Plane
Duplicate Enemy 3
Create a New Bullet that moves towards the plane
The action to move towards a point now has the following parameter:
One other change is required. As the bullet can fly in any direction it is a bit more difficult to test in the step event whether the bullet lies outside the room. But actually, there is a special event for this: the Outside event. In this event we simply put an action to destroy the object.
Create a Controller to add these planes
New Enemy 4 - Flying Up
Duplicate Enemy 4
Have this plane fly up from the bottom and re-spawn when it flies out the top.
Add a Controller to Randomly add these planes.
Be Creative and add elements to your game. You might
consider adding a turret, power ups, other enemies, a different level.
It is totally up to you, there are no requirements.
Post the following using the Template from assignment 1
.gm81 file and .exe file (embed drive folder)
Screenshots NOT required
Game Play Video
Self-evaluation form (embed form)
No Rubric - Evaluated for Completeness and Upgrades only Only