Game | Part 4 — Abstracting Entities into Platforms and Enemies, Killing Enemies, Hero Death, and Particle Explosions

0. Picking up from last post

Press the up arrow key if you have a keyboard or click (touch) the up arrow button on the screen if you have a touch screen device.

1. Abstracting entities into platforms and enemies

2. Jumping on enemies

3. Killing enemies

3. Death of our hero

4. Particle explosions

Jump on the enemy to see the enemy explode.

5. Bounce particles off of the floor

Jump on the enemy to see the enemy explode.

6. Further refinement of particle explosions

We are now reducing the particle size on each frame. We are also performing manual garbage collection by removing each particle from the particles array if the size is reduced below a minimum threshold. Also, if a particle has existed longer than a set number of frames then we also remove it from the particles array.

Conslusion

We now have enemies that we can kill and can also kill us! ☠️ We also built a particle explosion system.

Our next steps will be to introduce animated sprites for the characters, followed by scrolling the screen horizontally as the player moves left and right. Stay tuned! 📺