Task 4 Using a 2D Game Engine

Creation of my 2D SHMUP Game

In the beginning i created my project file and set up all of the essential setting for the game to work properly. I also set up all of the layers for future use which saves time and hassle.

 After setting up the desired settings i added my background and made it a tiled background so i scrolls forever seamlessly. I made the higher background move faster then the lower background to give the effect of height in the game

After completing the background and making as i would like i implemented the tileset that i created, this would be used to create the platforms that some enemies would spawn on, it would also make the game look better

After adding the tiles and making the game look better i added the scrolling mechanic in the game that would drive the game forward, doing this allows for progression throughout the level

I then added the player sprites to the game and i also adjusted his orientation so that the game would work properly and that the character sprite would face the right way.

I added some particle effects to my character sprite whilst moving forward to make the game much more vibrant and fun to play.

This is when the main mechanic of the game comes into play, the shooting mechanics were created using the "key is down" event to create a system that autofires. Instance variables were also created to put limits on the shooting so that the shooting mechanic isn't over powered or under powered.

This piece of code makes it so that the bullets shoot in a spray with each power up giving more bullets in a wider spread. This increase in bullets and spread is near essential for completing the game/level.

I added even more power-ups to help player through the game as it can get quite hectic near the end so you would need more bullets to help fend off the onslaught of enemies.

At this point i had to add a Health bar to indicate the players current health, this was done by setting the width to a instance variable "HP". As the player lost health the bar would decrease in width. Also health bar starts green but become increasingly more red as you lose health.

From this point enemies would be essential, i started with programming the was that is spawns in using a separate sprite that the real enemy would spawn on. As the real enemy would spawn it would fly straight for a moment then home in on the player.

I then added the instance variables for the enemies HP so that the enemy could be destroyed by the player, all of the variables like HP and Damage can be changed in testing according to the difficulty.

As the enemy would shoot straight towards the players direction it would also shoot a few bullets, i added the events for this to happen so when the enemy has the player in its sight it will shoot, i used the same shooting mechanics as the player (cooldown, firerate) but it fire as soon as the player is in its line of sight.

Upon shooting the enemy the enemies HP variable would go down by the damage of the bullet, when the HP variable reaches 0 or below the enemy would be destroyed and it would also spray out green blood, this is done with a particle effect. Also when the bug is not on screen it would be destroyed also. I started adding score numbers as a Global Variable to save time later.

I needed to add the enemy bullets events so that they could actually hurt the player, Along with the damage i also added a flash on the player when hit by the bullet, so when the player is hit the player will flash indicating that you got hit.
Along with the enemy bullets events that hurt the player i also had to adjust the collision of the player to better suit the players actual look. i decided not to include the wings in the hitbox as i think that the players hitbox would become too large and it may be too hard to dodge all of the incoming enemy fire.
With the player now able to die i added a death animation to him to add some flare. After the players HP is 0 he player sprite is destroyed and a clone of it is created in its place, the clone then rotates and shrinks to imitate it falling out of the sky.
Now i added a new enemy, the Bee Spawner. This enemy will create bee that track the player. First i imported the sprite and adjusted the collision mask for future use.









This is the code that i created to make the bee launcher work, i made it so that it spawns some bees and then those bee would split into 2 bees when killed.
This is the code for the boss enemy

This is the boss that i created using Piskel

This is the title screen that i created for this game to make it look better.