Game Development Reference
In-Depth Information
Figure 13-16 . Hold a left arrow (or A) and up arrow (or W) key down at the same time, and move the Actor diagon-
ally
Adding Jump and Evade Animation: Using the W and
S Keys
Let's start to put into place the infrastructure for using another set of four keys to give
our players more flexibility in implementing sprite (character) actions (animation).
Using the keyboard, these would use the ASDW keys, and using a game controller,
these would use the JavaFX KeyCode class constants GAME_A, GAME_B,
GAME_C, and GAME_D. I'll be adding game controller event handling a bit later on
during my game development after I add in more game play logic. The implementation
of the basic jump and evade (projectiles) sprite cel Image assets would be accom-
plished by using the following two basic Java conditional if() structures for using the
W key via if(invinciBagel.iswKey()) and the S key via
 
Search WWH ::




Custom Search