|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgame.core.Sprite
public class Sprite
a Sprite - an object that moves around in a game
Field Summary | |
---|---|
protected double |
age
The age of this Sprite |
protected double |
dx
The velocity of the sprite |
protected double |
dy
The velocity of the sprite |
double |
r
The radius of the sprite |
protected double |
x
the position of the sprite |
protected double |
y
the position of the sprite |
Constructor Summary | |
---|---|
Sprite(double x,
double y,
double dx,
double dy,
double r)
constructs a sprite with the given characteristics |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
double |
getDX()
|
double |
getDY()
|
double |
getSize()
|
double |
getX()
|
double |
getY()
|
boolean |
touches(Sprite sp,
java.awt.Rectangle rr)
returns true if the this Sprite is touching the other |
void |
updatePositionWrap(java.awt.Rectangle r)
updates the position of this sprite, bounding it within the given Rectangle by wrapping the Rectangle into a torus |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double x
protected double y
protected double dx
protected double dy
public double r
protected double age
Constructor Detail |
---|
public Sprite(double x, double y, double dx, double dy, double r)
Method Detail |
---|
public boolean touches(Sprite sp, java.awt.Rectangle rr)
public void updatePositionWrap(java.awt.Rectangle r)
public java.lang.Object clone()
clone
in class java.lang.Object
public double getX()
public double getY()
public double getDX()
public double getDY()
public double getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |