Week 5: Midterm Progress Report

Concept:

I have been playing “Survivor.io” as a leisure game whenever I have free time or in-between classes just to pass the time. This game is a small mobile based game with the objective of surviving waves of attacks from a swarm of enemies that approach you and inflict damage when they touch you. We are given with a basic weapon in the beginning which we upgrade as we kill the enemies and survive the wave. The objective of the game is to farm weapons and survive for the longest time possible. I thought of implementing this game in p5js as my midterm project.

Survivor.io - Apps on Google Play

I have made quite a progress with my game by implementing the following features:

  1. A starting screen which describes the objective of the game.
  2. A playing screen where the player can control a character and kill minions. For now, the players, minions and weapons are just blobs with color.
  3. A game over screen where the time the player endured the waves is shown with a “Play Again” button.

Most Terrifying Part:

The most frightening part of the code so far was the collision detection of the “weapon & minions” and “minions & player” and killing the minions or the player when enough collision is made. The confusion lied on how to detect collision for all the minions and all the weapons. The solution I came up with is as follows:

  1. Weapons & Minions: I would detect the collision in the Minions class. Then we consider all the Arrows for the current minion. We call this detectArrowHit in the Minions class for all the minions in the minions array.
  2. Minions & Player: The same concept was applied for this collision, except the collision algorithm is implemented in the Player class, where we consider all the Minions present in the minions array.

As for the effects of the collision, I am still working on it and fine-tuning the effects of the collision. For now, I delete the minion which are hit from the minions array.  In doing so, it brings the problem of indexing in the minions array which is used to identify a minion in the canvas.

Future Progress and Reflection:

So far, the project is going smooth with all the bugs that I encountered getting solved fairly quickly. Here are a few things I need to work on:

  1. Sound track for the entire game.
  2. Sound effects for weapon firing, minions and player dying.
  3. Power-up for the player when it gets very hard to survive.
  4. Mechanism to regain health when certain criteria is matched.
  5. Images for the player, minions and weapons

The code is getting longer and longer very quickly, so I will probably divide the code into more JS files, just to make everything readable and understandable.

Leave a Reply