Blog Archive

Wednesday, 24 February 2016

Assignment 2: 3 in 1 gaming - Space Invaders Game

Game Design Brief

Development:

Sprites – Alien sprites, Player sprite and boss sprite

Sounds – background music, shooting sound, death sound, enemy killed sound

Levels – 3-5

Other elements – high score board, destructible walls for protection,

Customer

What does the customer want? – Space invaders game, like the original

What does the design brief say? - Create space invader clone game.

You can make it look as close to the original as possible OR make your own version of a space invader game. Top down.

Target Audience – Anyone


Management

By the end of the session – Create sprites and movement

How long do we have?  4 Weeks


Task break down:

Sprites design and animation

Background

Objects

Sounds

Scoring

End of session 2 - Add shooting elements with scoring

End of session 3 - Multiple rooms and bosses

End of session 4 - Highscore board and lives

End of session 5 - Add multiple levels with increasing difficulty

Sprites




For the sprites I tried to use the same style as the original game, so I included three enemies, plus a mothership and a larger boss to use for the final level. These were all created within gamemaker, using images from the original game to make them look as accurate as possible. I tried to make it easy for the player to distinguish what was good and bad in the game so I made everything that was negative in the game a white colour, such as the enemies and the bullets they shoot, whilst the player is green, along with the bullets you shoot, and also the lives found in the bottom right hand corner. The sprites for quitting and restarting are simply text buttons that when shot will do the corresponding action. The bullet sprites are used for the weaponry that the player and the enemies shoot. The barricade is a sprite that wasn't used within the game, due to the fact that even though it works I didn't think they looked good enough to go into the final game.

Sounds





In my game I have used five sounds to try and help to recreate the retro feel of the space invaders game. I have a sound for when the player is hit by an enemy bullet, a sound for when an enemy alien is killed, a sound for when the player shoots, and also a sound for when the boss shoots. There is also some background music for the game.



Objects

In my game I have many objects due to the fact that their are a few different types of enemies in my game, and also the fact that I have to have objects for the bullets that are shot by both the enemies and the players. I also have spriteless objects for the controller for the game, along with some other objects that help with certain parts of the game.

obj_enemy (1,2 and 3)

The three normal enemies in the game have the same actions and events, just with different sprites attached to them. In the create event there is a piece of code that slows down the animation speed of the sprite, then a couple of drag and drop options that set an alarm to 100 steps, and sets the vertical speed of the enemies to 0.2.
In the alarm.event, the game takes the probability of 1 in 10 as whether it is going to create a bullet, which means that there is a 10% chance that the enemy will shoot a bullet at the player. The alarm then resets to 50 steps, meaning that after the first shot the enemies have a much higher chance to shoot. This gives the player a bit of time to get prepared for the level before the shooting rate of the enemies increases. In the step event, the game checks whether the enemies have reached far enough down the y axis to end the game, as if the enemies get too far down the screen, it counts as a game over. Finally the collision event with the player bullet plays the sound of the enemy dying, and destroys the instance.

Obj_miniboss and obj_boss

Overall, the majority of the events in the these two objects are very similar to the normal enemies, with some of the values for probability of shooting and the alarms reduced in order to make these enemies fire faster in order to increase the difficulty of these enemies. However, there are some notable differences between these harder enemies and the normal enemies and that is that they can move side to side. This creates some changes in the code as it gives these enemies starting horizontal speed variable. In the step event the code states that when these enemies hit the walls at the side of the room, it reverses the speed of the enemy, thus making it go in the opposite direction.
The only real difference between the boss and the miniboss is that the boss is a larger sprite, and also has a health bar and shoots larger bullets, however, the health is dealt with in another object.

All of these objects have a parent object, which is a spriteless object with no events in it. It is just used when moving on to the next level through the controller. 

obj_player



To start with the player object has some very standard commands, with the left and right keys used to move those ways respectively, it has collisions with each of the enemy bullets within the game that destroy the player and remove a life from the player. The more complicated parts involved with the player come with the ability to shoot bullets at the enemy, as it can't work on a probability basis as the player needs to shoot whenever the space button is pressed. To get around this, I used a variable called canShoot, which is said to true in the create event. This means that when the player object is created, it can shoot a bullet as the variable is set to true. However, when the player presses the space bar, the step event changes the variable to false and sets an alarm to 15 steps, and then creates the bullet. Once this alarm is up the variable is simply set back to true and the player can shoot again. This stops the player being able to shoot a huge amount of bullets and make the game super simple. The player object is set as persistent so that when the room changes the player stays in the same position that they were already in, which makes the game less jarring for the player.

Controller
In the create event of the controller, it sets a global variable for name, which is used later on when adding your name to the high score board. It also sets a variable which makes your last score equal your score, which is used when adding lives when you reach a certain score. Finally, the create event sets the number of lives for the player, starting at three. the step event of the controller is probably the most complicated piece of code within my game; it deals with the progression of rooms, the high score board, and the adding of lives when you reach a certain number of points in the score. Firstly, the game checks whether there are any objects with the alien parent within the room, and if there are none, it moves the game onto the next room. Secondly, the game checks whether the players lives equals zero. When that happens the game displays a message telling them that the game is over, and that they should enter their name in order to be entered into the highscore board. The game then adds that name to the highscore board along with their score. It then sends the player to the highscore room where the highscore is drawn and visible to the player, also setting the score to 0 and the lives back to 3 so that the player doesn't automatically die when they are taken to the highscore room. Finally, the game checks whether the score that you have is divisible by 1000, and if it is then the player gets a life. It also checks that after it does that the last score does not equal the score so you don't get an infinite amount of lives when they have a number divisible by 1000. The escape key is just there in order to clear the scoreboard so that people can start a fresh scoreboard if they wish. The controller object is also persistent in order to keep the lives at the same amount as the room before, as well as the score.

obj_hcontrol and o_highscore



In these two objects there are two simple events that simply draw the respective objects into their rooms. These objects are only placed in specific rooms, with the highscore object only in the highscore room due to the fact that I only want that to be drawn in that specific room. The health object is only drawn in a room that includes a boss due to the fact that it draws the healthbar of the boss and I don't want that to be in any other room as it may confuse the player as they would be shooting enemies and the health bar would not be going down.

Rooms


My space invaders game has 10 rooms for gameplay and then a room where the highscore is drawn into the game, with options to create more rooms at some point.

Gameplay Videos

My Playthrough



My thoughts and evaluation

I think that the game fits the classic retro feel with the art style and the designs of the sprites, which is the idea I was going for when I first started planning for this game. I also managed to stick to my schedule and timing plan which meant that the majority of the game was completed is plenty of time before the deadline. However, I am disappointed that I didn't manage to finish off the destructible bunkers for my game, due to the fact that I didn't think the sprites looked good within the game and made it look very blocky and unpleasing to look at. The sprite had 5 different frames in which I had coded to change to the next one each time they were hit with a bullet, until the final frame in which they were destroyed. Furthermore, due to the majority of enemies only moving downwards, the bunkers didn't serve much purpose as they did in the original game as they would just get destroyed whilst not allowing the player to shoot the enemies behind the bunker until it was destroyed anyway. Another thing I would've liked to have added to my game is some kind of power up, such as a limited time shield which made the player invincible for a short time. I think this could have been done by when you press a certain key, the sprite of the player changes to something that would signify that the shield had been activated, and then when the player had this sprite, the enemy bullets would do no damage. I do like the fact that I have a boss which has a health bar and also moves side to side, as that helps to add to the difficulty of the game. Overall I think that the game is a decent representation of the original space invaders, with the design and the retro sound effects, although I believe I could've improved the game and made it a bit more complicated with more moving enemies, better designed bunkers and power ups.

Sister's Playthrough



Sister's thoughts:

What Went Well: The game is very enjoyable, yet challenging which keeps it interesting and makes you competitive. Had a good variety of enemies and I enjoyed the boss even though I died on that level.

Even Better If : I didn't get stuck in the wall when I went to the next level, although Josh fixed this straight away as there were some objects that moved when the room change which were in the wrong place, which he moved and the game worked perfectly afterwards.

No comments:

Post a Comment