Class gjt.animation.Sprite
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.animation.Sprite

java.lang.Object
   |
   +----gjt.animation.Sprite

public class Sprite
extends Object
A sequence of images which are animated and moved about on a Playfield.

Each Sprite is constructed with a reference to it's Playfield, a Sequence, and a beginning position for it's upper left hand corner.

A Sprite's animation is controlled by invoking the following methods:

setMoveVector(Point)
setMoveInterval(long)
setImageChangeInterval(long)
setMainSequence(Sequence)
setSequence(Sequence)
See Also:
Sequence, Playfield, SpriteCollisionDetector, SimpleAnimationTest, BumpAnimationTest, TwoDrinkersAnimationTest

Constructor Index

 o Sprite(Playfield, Sequence, Point)

Method Index

 o animate()
 o clipRect()
 o curBounds()
 o getMainSequence()
 o getMoveVector()
 o getPlayfield()
 o getSequence()
 o height()
 o intersects(Sprite)
 o location()
 o move()
 o moveTo(Point)
 o needsRepainting()
 o nextBounds()
 o nextLocation()
 o paint(Graphics)
 o play(Sequence, long)
 o reverse()
 o reverseX()
 o reverseY()
 o setImageChangeInterval(long)
 o setMainSequence(Sequence)
 o setMoveInterval(long)
 o setMoveVector(Point)
 o setSequence(Sequence)
 o start()
 o timeToChangeImage()
 o timeToMove()
 o width()
 o willIntersect(Sprite)

Constructors

 o Sprite
  public Sprite(Playfield field,
                Sequence sequence,
                Point ulhc)

Methods

 o getPlayfield
  public Playfield getPlayfield()
 o clipRect
  public Rectangle clipRect()
 o curBounds
  public Rectangle curBounds()
 o width
  public int width()
 o height
  public int height()
 o reverseX
  public void reverseX()
 o reverseY
  public void reverseY()
 o reverse
  public void reverse()
 o start
  public Point start()
 o setMoveVector
  public void setMoveVector(Point p)
 o getMoveVector
  public Point getMoveVector()
 o play
  public void play(Sequence sequence,
                   long cycles)
 o animate
  public void animate()
 o setMainSequence
  public void setMainSequence(Sequence sequence)
 o getMainSequence
  public Sequence getMainSequence()
 o setSequence
  public void setSequence(Sequence sequence)
 o getSequence
  public Sequence getSequence()
 o intersects
  public boolean intersects(Sprite otherSprite)
 o willIntersect
  public boolean willIntersect(Sprite otherSprite)
 o timeToMove
  public boolean timeToMove()
 o timeToChangeImage
  public boolean timeToChangeImage()
 o moveTo
  public void moveTo(Point p)
 o needsRepainting
  public boolean needsRepainting()
 o setMoveInterval
  public void setMoveInterval(long interval)
 o setImageChangeInterval
  public void setImageChangeInterval(long interval)
 o move
  public void move()
 o location
  public Point location()
 o nextLocation
  public Point nextLocation()
 o nextBounds
  public Rectangle nextBounds()
 o paint
  public void paint(Graphics g)

All Packages  Class Hierarchy  This Package  Previous  Next  Index