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. 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 two bullets every second, that is, one bullet every 15 steps. To achieve this we use a variable 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.
event we set the variable can_shoot back to
1, indicating that we can shoot again. So the event for the
space key will look something like this:
Collision Event with the Bullet
Play a sound, play an explosion, respawn the enemy off 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. 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
Later we will give the main plane damage.
planes as the game continues. Just like we did with the bombs.
Create an controller_enemy object . In its creation event we create an enemy place at a random location just above the room. This will be the first enemy. We also set the alarm clock to 200. In the event for this alarm clock we create another enemy plane and set the alarm clock again, but this time to 500. That is all. The effect is that at the beginning of the game there is one enemy plane. After 200 steps, that is, about seven seconds, a second enemy plane appears. After about 15 seconds, a third plane appears, etc. (The reason that we let the second plane appears faster than the other ones is because the game with just one enemy plane is too boring.) Place one instance of the controller object in the room and we are done.
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.
I placed mine at the bottom of the screen
This will place the correct sprite at the bottom of the screen. To make sure that the bottom panel lies above everything else we give the controller_life object a depth of –10000.
In its creation event, the controller_life object sets the score to 0, the number of lives to 3, and the health to 100.
Draw the score, healthbar and lives
Drawing a Health Bar that is 100 wide and 10 high
Reset the health, explode the main plane
After the Plane explodes, (Animation End of the Explosion) destroy the explosion, create a new plane and subtract a life
On No More Lives show the high-score list and restart the game.
Modifying your Enemies
Enemy 1 and 2 will fire bullets straight down at different frequencies, enemy 3 will fire bullets towards the main plane, enemy 4 will not fire bullets but comes from the bottom of the room and is more difficult to avoid or shoot.
Enemy 1, 2 - Shooting Straight Down
Create an enemy bullet. In create set the vertical speed . In the collision event of this bullet with the main plane we set the health relative to -5, destroy the bullet, and play a sound. Destroy the bullet when it leaves the room
Have the Enemy shoot 1
time out of 30 (Note: you could also use an alarm)
Feel free to modify the shooting.
Enemy 3 - Shooting at the Main Plane
Create a different enemy bullet object. The enemy plane creates this new type of bullet in its step event. Again use the dice action but now we only create a bullet once every 80 steps, because our new type of bullet is a lot harder to avoid.
On the bullet create set the bullet to move towards the plane
Enemy 4 - Flying Up
Finally have your 4th enemy fly up. Spawn additional planes over time. (Change the random location x value)
Using the ideas of the bombs in Fruit mania spawn more enemies over time.
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 everything to your website using the template. We will not be completing peer evaluations for this game.
Link to the Rubric