Save the Faces!

save

 

Save the Faces! is a simple 2D top down shooter that I created in my Programming Fundamentals class. The purpose of the project was to implement all of what we learned in that class into a simple game. The game was made in Perlenspiel, a JavaScript based game engine that’s limited to a 2D grid. Now the bulk of the this project was to implement game elements such as implementing a pause state and implementing lives. The 3rd game element I added was what turned it into a top down shooter: projectiles. My major hurdle with implementing projectiles was registering a collision hit between the bullet and an enemy. Although my initial attempt was to simply clear out the cell where the bullet and enemy collide was working on the bullet side, it didn’t seem to register with the enemy so instead it looked like enemies were just eating everything I would shoot at them. The root of the problem lies in the fact that wasn’t removing the enemy from the update array, so even though a collision gets registered, the way my update function for enemies worked was that it would always draw an enemy given that index. The fix to the problem was to make a function that not only removed the bullet from the bullet array but to also to remove the enemy from the enemy array since both those indexes would be the same at the time of collision. If I included all the time it took me to learn Perlenspiel/JavaScript and the creation of this game, then would’ve taken me around 3 weeks to create this game. To download and try game get it  here.

Advertisements