Game Development Reference
In-Depth Information
Figure 14-15.
The battle panel in action
Handling Battle Button Events
When a battle button is selected, the game should take action. Because a custom event was dispatched when clicked,
the event now carries the button's
attackType
string with it. Listing 14-34 shows how this is accessed in the event
handler
onAttackButtonSelected
and the methods that it fires based on that value.