Game Development Reference
In-Depth Information
Figure 13-13 . Add if() statement logic to exclude processing of nested if() hierarchy if down/up keys pressed to
isRight()
Next, let's make the ASDW keys their own sprite control keys, instead of having
them mimic the arrow keys.
Adding Event Handling: Giving ASDW
Keys Function
Since I have a few more sprite states that I want to implement, I'm going to upgrade
the event handler to use a two-handed play scenario, using arrow keys with ASDW, or
ABCD (color) game controller buttons, using this code upgrade:
 
Search WWH ::




Custom Search