For my midterm project, I decided to do a Space Invaders-inspired shooting game with space ships and aliens. The game was partly inspired by a mobile game called: Radiant. The game’s main feature was an array of weapons in which the player could freely switch between. Because each weapon type had its own advantages and disadvantages, you had to switch between all of them to successfully complete the game. I wanted to incorporate this element into my shooter game to make it more unique and be more interactive and replayable.
Game Design
The game begins on a menu screen, where the player sees the game title and has access to all the instructions they need to play the game. I found a really cool arcade-style font that really matched the theme of the game. Because the game instructions were relatively minimal there was no need to have mutliples screens of text.
Then when the game begins the player is spawned and enemies start spawning from the top of the screen at regular intervals, with the interval decreasing over time to increase the difficulty of the game. The enemies path directly towards the player, ending the game if even one of them touches the player. Because of the number of enemies already present, I did not make the enemies fire any shots.
The player had access to 6 different type of weapons, normal shots, machine gun, shot gun, laser and other settings that all had their own characteristic. The player could switch at anytime by pressing the number keys 1-6. Each type of shot deals different amounts of damage to enemies.
When the player is hit by an enemy the game cuts to a GAME OVER screen. The player can then press play again to restart the game.
Challenges
One problem I continuously faced was when the alien sprites because of the way they were coded, were often the wrong size and unable to be resized by the variables. I had to consult p5 reference for a while to fix this.
Another problem I had faced for a long time was getting the shot type to switch to the proper type of shots. After tutorials and looking at other projects I switching with cases allowed me to control this as well as shot spread with the keyboard numbers.
Lastly, one thing I was surprised was so challenging was assigning a sound to play when the game ended (I ended up forgoing this). There was no way to easily play a sound once without looping when my game state switched.
damage = 6 break case 4: color = [255, 255, 0] width = 15 height = 10 speed = 12 damage = 1.5 break; case 5: color = [255, 50, 255] width = 8 height = 24 speed = 15 damage = 3 break; case 6: color = [170, 50, 255] width = 5 height = 35 speed = 25 damage = 3 break }
function keyPressed() { if (key === '2') { shotType = 2 cooldown = 150 } else if (key === '1') { shotType = 1 cooldown = 400 } else if (key === '3') { shotType = 3 cooldown = 800 } else if (key === '4') { shotType = 4 cooldown = 600 } else if (key === '5') { shotType = 5 cooldown = 500 } else if (key === '6') { shotType = 6 cooldown = 600; } }
Future Improvements
There are so many ways to potentially improve this game. One way is to definitely have more enemy types that would resist or be weak towards different types of projectiles. This would further incentivise the player to switch weapons, allowing the game to be more engaging.
Another potential improvement is improving the movement patterns of the aliens to be more challenging. If they moved unpredictably towards the player that allowed them to “dodge” shots, the game would have a whole other level of challenge.
Lastly, A scorekeeping method or score in the top left corner would be very useful and would make the game feel like its progressing- this is probably the first change I would want to implement.