Animating Your Action Figure States: Setting the Image States Based on KeyEvent Processing

  • Wallace Jackson


Now that we have also organized your Java code into logical methods in the class, as well as making sure that all of our Java code is standards compliant in Chapters 11 and 12, it is time to get into some more complicated code structures that will animate our InvinciBagel character on the screen as the user moves the character. For instance, if the character is traveling due East or due West (using only left or right keypresses, to travel in a straight line), he should be running (alternating between the imageStates(1) and imageStates(2) List<Image> elements). If the up key is also pressed, he should be leaping up in the direction of the left or right keypress, and if the down key is pressed, he should be preparing to land in the direction of the left or right keypress.


Programming Logic Game Play Collision Detection Method Call Pulse Event 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Wallace Jackson 2014

Authors and Affiliations

  • Wallace Jackson
    • 1
  1. 1.CAUnited States

Personalised recommendations