|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object physics.IMotion physics.GravityMotion
public class GravityMotion
GravityMotion.java Created: Thu Nov 11 13:30:05 2004
IMotion
that mimics gravityConstructor Summary | |
---|---|
GravityMotion(CollisionObject colOb)
Creates a new GravityMotion instance. |
Method Summary | |
---|---|
void |
bounce(CollisionObject co)
A bounce for this motion |
int |
getDX()
Returns dx of the velocity |
int |
getDY()
Returns dy of the velocity |
int |
getSpeed()
Returns the speed of the motion |
void |
setDX(int dx)
Set the DX direction |
void |
setDY(int dy)
Sets the DY direction |
void |
setGravity(int g)
Override to do something useful |
void |
setVelocity(int dx,
int dy,
int speed)
Sets the velocity of the motion |
void |
start()
Starts the MotionTimer for this motion |
void |
stop()
Stops the MotionTimer for this object |
void |
timerReact()
Moves the object at intervals decided by the timer and checks for collisions |
Methods inherited from class physics.IMotion |
---|
changeMomentum, getCollided, getVelocity, setCoefficient, setDX, setDY, setLocation, switchMomentum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GravityMotion(CollisionObject colOb)
GravityMotion
instance.
colOb
- a CollisionObject
valueMethod Detail |
---|
public void setGravity(int g)
IMotion
setGravity
in class IMotion
g
- an int
valuepublic void setVelocity(int dx, int dy, int speed)
setVelocity
in class IMotion
dx
- -
change in x directiondy
- -
change in y directionspeed
- -
Timer delaypublic int getSpeed()
getSpeed
in class IMotion
public int getDX()
getDX
in class IMotion
public int getDY()
getDY
in class IMotion
public void timerReact()
timerReact
in class IMotion
public void start()
start
in class IMotion
public void stop()
stop
in class IMotion
public void bounce(CollisionObject co)
bounce
in class IMotion
co
- a CollisionObject
valuepublic void setDX(int dx)
setDX
in class IMotion
public void setDY(int dy)
setDY
in class IMotion
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |