Health bars help determine how many more hits an enemy can take before they're removed from the game. Lucky for us, we can create them quite simply using two fillRect
methods that overlap small rectangles on top of each other. After rendering these health bars, we'll decrease their width for each time an enemy receives a projectile hit. When an enemies health reaches 0, we'll remove them from the game completely.
0:00 Render health bar
3:33 Reduce enemy health
6:57 Remove enemies when health equals 0