Problem 28
Modulus Animation
In this program, you’ll use a loop to draw a simple ASCII-based animation on the screen,
and you will use modulus (%
) to determine which frame of the animation to show.
(You will learn how to create your own loops later.)
Files Needed
- ModulusAnimation.java - modify and turn in this one
- ModulusAnimationWorm.java - first example
- ModulusAnimationSymbols.java - second example
What You Should See
If you download, compile and run ModulusAnimationWorm.java
it will look roughly like this.
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
********
(It will look cooler while it’s running.)
What You Should Do on Your Own
Assignments turned in without these things will receive no credit.
- Add several if statements in
ModulusAnimation.java
so that it draws a little animation of your choosing. - You must have a minimum of eight (8) different frames of animation, and it must loop smoothly.
◄ 27: A Little Quiz 29: Using Swing for Input ►
Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.