Inspiration
From the past year, the spread of deadly Corona virus changed our normal living life. It is extremely dangerous that the death tolls were rising every single day in the past year. But as of now, doctors and scientists worked through and devised a vaccine for our better future generations. However, many people are hesitating and avoiding to get vaccinated and are completely being irresponsible citizen. They are even protesting against vaccines and not wearing masks. The main reason why people are not getting vaccinated is because they do not see COVID as a threat. But it is a threat, in fact, a significantly dangerous threat to human race. What if humans continued to avoid vaccines? What if COVID got extremely stronger? What if it evolves into intensely threatening virus compared to existing Corona virus? What if it emerges to turning human into zombies?
What it does
Based off my inspiration, I have created a game involving zombies, which are deadlier than the Corona virus. It is a zombie apocalypse and the main character has to kill all the zombies before zombies hits the bar or before the health bar turns into red. As the time progresses in the game and user passes on to next levels, zombies start to move faster and adds by double than their previous level. There is no proper winning for the game, because the exponential rate of zombies growth and their fast movements makes it impossible for one single character to kill them all. In fact, it is created this way to establish the analogous between zombies and corona virus and to illustrate the rapid spread and how it becomes difficult as levels pass on.
How I built it
I have used javascript programming language to completely build this game. On the platform called code.org, I have designed and coded the entire game. Starting with the design, I used all my creativity to make texts in fancier text, added zombie pictures, included sounds of bullet shoots, and created an illusion of game screen moving. In between the start and actually playing the game, there are couple extra screens explaining the game back story and what the main character suppose to do. I have also implemented an Help/Info screen in the beginning of the game to introduce the game to players. Then with coding, I used all my javascript knowledge to code up a successfully working zombie apocalypse game. I have implemented the game by using variables, setting health bar, event handlers, and a lot of helper functions. Main aspect of my game are event handlers and mouse control, since the whole game is using mouse. I focused and developed successfully working mouse event handlers to control the game.
Challenges I ran into
During the development of the game, I ran into numerous challenges and conflicts that have improved my game quality. One of them is determining the angle and the distance of a mouse click from the bullet's origin (from the main character). To solve this, I have decided that every angle must have same speed. Then using the distance formula, I get the x and y coordinates for the distance of 10 from the bullet's origin towards the mouse click. In terms of angle, I have simply calculated the slope between the x and y coordinates. Then in a timed loop function for every 17 milliseconds, which calls the update() function, the x and y coordinates are incremented by the distance of 10 towards the mouse click. So, in final the bullet moves forward in increments of distance 10 towards the mouse click. Another important conflict I ran into was enemies spawn, which is the growth of zombies as level passes. Since we cannot have infinite zombies to be killed by the player, I have created a new variable called i to increment the counter of levels and number of zombies to spawn.
Accomplishments that I'm proud of
First of all, my greatest accomplishment is creating a successfully working game in the end. Zombie apocalypse game involves many great aspects from simply screens of text to an only mouse controlled game. My greatest achievement would be the mouse control in the game. Using keyboards key or arrow keys might have been simpler to code but I chose mouse click since it is easier for player to play the game. I have used all sort of formulas - distance formula, slope, and even trigonometry (arctan) - for rotating the character to aiming to successfully shooting at the zombie. The mouse control will be the best feature of my game, along with some creative text, pictures, and back story (analogy with Corona virus).
What I learned
I learned the importance of math in programming. Without even realizing, I came up with solution to my challenges and mouse control by using math formulas I learned from High school. Not only math, but I have also improved in javascript coding by using complex timed loops and spawn of enemies while the game is running.
What's next for Zombie Apocalypse
For future of Zombie Apocalypse, I think we can implement more features such as using the score towards a prize, and in fact setting a win to the game. As of right now, the game current state is successfully working and shares an important message in regards to COVID. This is best game I could have ever developed within 2 days.
Built With
- canva
- code.org
- javascript

Log in or sign up for Devpost to join the conversation.