diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-25 22:18:58 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-25 22:18:58 +0000 |
commit | 7a5fe8ce23ac50450b804cf0183c773565ae7cef (patch) | |
tree | 220a38a6627619d1386897d42757a140b9de448f /java/gjt/test/SimpleAnimationTest.java | |
parent | 87b0987cad99cf45cd5d9e03cd1cefbaaec4ef2a (diff) | |
download | ATCD-ACE-4_4.tar.gz |
This commit was manufactured by cvs2svn to create branch 'ACE-4_4'.ACE-4_4
Diffstat (limited to 'java/gjt/test/SimpleAnimationTest.java')
-rw-r--r-- | java/gjt/test/SimpleAnimationTest.java | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/java/gjt/test/SimpleAnimationTest.java b/java/gjt/test/SimpleAnimationTest.java deleted file mode 100644 index faf0c7c611c..00000000000 --- a/java/gjt/test/SimpleAnimationTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package gjt.test; - -import java.net.URL; -import java.applet.Applet; -import java.awt.*; - -import gjt.Util; -import gjt.Orientation; -import gjt.animation.*; - -/** - * An animation playfield containing a lone sprite that bounces - * off the boundaries of the playfield.<p> - * - * @version 1.0, Apr 1 1996 - * @author David Geary - * @see gjt.test.AnimationTest - * @see gjt.animation.Playfield - * @see gjt.animation.Sprite - */ -public class SimpleAnimationTest extends UnitTest { - public String title() { - return "Simple Animation - Mouse Down Starts/Stops"; - } - public Panel centerPanel() { - return new SimpleAnimationTestPanel(this); - } -} - -class SimpleAnimationTestPanel extends Panel { - public SimpleAnimationTestPanel(Applet applet) { - setLayout(new BorderLayout()); - add("Center", new SimplePlayfield(applet)); - } -} - -class SimplePlayfield extends Playfield { - private Applet applet; - private URL cb; - private Sprite javaDrinker; - private Sequence spinSequence; - - public SimplePlayfield(Applet applet) { - this.applet = applet; - cb = applet.getCodeBase(); - makeSequencesAndSprites(); - } - public void paintBackground(Graphics g) { - Image bg = applet.getImage(cb, "gifs/background.gif"); - Util.wallPaper(this, g, bg); - } - public boolean mouseDown(Event event, int x, int y) { - if(running() == true) stop (); - else start(); - return true; - } - public void spriteCollision(Sprite sprite, Sprite sprite2) { - // Nothing to do: only 1 sprite! - } - public void edgeCollision(Sprite sprite, - Orientation orientation) { - if(orientation == Orientation.RIGHT || - orientation == Orientation.LEFT) - sprite.reverseX(); - else - sprite.reverseY(); - } - private void makeSequencesAndSprites() { - String file; - Point startLoc = new Point(10, 10); - Image[] spinImages = new Image[19]; - - for(int i=0; i < spinImages.length; ++i) { - file = "gifs/spin"; - - if(i < 10) file += "0" + i + ".gif"; - else file += i + ".gif"; - - spinImages[i] = applet.getImage(cb, file); - } - spinSequence = new Sequence(this, spinImages); - javaDrinker = new Sprite(this, spinSequence, startLoc); - - javaDrinker.setMoveVector(new Point(2,2)); - addSprite(javaDrinker); - } -} |