Premium Features

Download Video

Populate Attacks Based on Chosen Monster

Published 3 years ago

Our attack options are currently hard-coded into our interface, meaning, if we were to use a different monster, our attack options would remain the same (they should be different).

This episode will show you how to populate your interface's attack section from the attacks associated with each monster we create. To do so, we'll create a data object for our monsters, give them an attacks array, then extend our Sprite class into a Monster class.

  • 0:00 - Generate Button with JavaScript

  • 2:06 - Create Monsters Data Object

  • 6:30 - Create Monster Class from Sprite Class

  • 11:43 - Populate Buttons From Monster Attacks

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.