Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

UNLOCK LESSON

Premium Features

Download Video

Health Bars

Published 2 years ago

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

Comments

Want to participate?

Create a free Chris Courses account to begin

Login

No comments yet, be the first to add one

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.