Asteroids JS
Winter 2019
My first attempt at recreating the classic Asteroids game. This was my endeavour to create a larger game, bigger than Snake, Connect Four, Tic-Tac-Toe, or Chess.
Key Features
- Physics: The combat system involves sending events between the player and the enemy based on hits. This is controlled via a state machine that links to the animation to be played. Normal hits inflict some damage, but if the poise is full, the poise ring is reset, and the damage is multiplied. The poise ring decreases over time and only increases from each hit. Dodging creates a small window where you cannot be hit. You can also parry, which, if timed just before a hit, will prevent damage and stun the enemy. If parry is held for too long, the hit will only be blocked without stunning the enemy.
- Particle Effects: I want to try some particle effects, so I created my own particles that shrink and decay over time. Small particles appear when asteroids collide. When the ship collides, I made a few rectangles be the particles to represent parts of the ship. Lastly, for thrusting, I added a red triangle to the ship's bottom with a random offset to imitate thrusting fire.
Challenges, solutions and lessons learnt
This was my first larger game that I created, so my main learning experience was leveraging Object-Oriented Programming (OOP) techniques I had just learned to manage a larger project with many interacting mechanics, such as shooting and collision detection. I also learned how quickly you can create prototypes in JavaScript, but I also realized how inefficient it can be, making it unsuitable for larger games.
Embedded Game
![Placeholder Image](../Assets/Asteroids.png)