|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulation_InteractiveVersion.sprites.BasicSpriteReverse
public class BasicSpriteReverse
This class encapsulates a sprite which is a circle of diameter 10 units and color magenta. The sprite's initial position is randomly chosen. For each frame, this sprite moves 1 unit up and 1 unit to the left, wrapping around the canvas when the boundaries are encountered.
Constructor Summary | |
---|---|
BasicSpriteReverse(int widthOfDrawingRegion,
int heightOfDrawingRegion)
Creates a sprite within a game world with the specified dimensions. |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics2D g)
Takes the passed Graphics2D object and specifies how this sprite should be drawn on it. |
void |
move()
Specify what should happen at each frame. |
void |
setPaint(java.awt.Paint p)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicSpriteReverse(int widthOfDrawingRegion, int heightOfDrawingRegion)
widthOfDrawingRegion
- as described aboveheightOfDrawingRegion
- as described aboveMethod Detail |
---|
public void setPaint(java.awt.Paint p)
public void draw(java.awt.Graphics2D g)
Sprite
draw
in interface Sprite
public void move()
Sprite
move
in interface Sprite
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |