April 2018
Beginner
714 pages
18h 21m
English
To practice sprite transitions, your goal is to extend the state machine of Benjamin's SpriteSequence element to make him wiggle his tail when the elephant is standing still. You can find the appropriate sprite in the materials that come included with this book. The sprite field is called wiggling.png. Implement the functionality by making it probable that Benjamin spontaneously goes from the "still" state to "wiggling". Pay attention to ensure that the animal stops wiggling and starts walking the moment the player activates the right or left arrow keys.
Read now
Unlock full access