|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphysics.IMotion
physics.GravityMotion
public class GravityMotion
GravityMotion.java Created: Thu Nov 11 13:30:05 2004
IMotion that mimics gravity| Constructor 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GravityMotion(CollisionObject colOb)
GravityMotion instance.
colOb - a CollisionObject value| Method Detail |
|---|
public void setGravity(int g)
IMotion
setGravity in class IMotiong - an int value
public void setVelocity(int dx,
int dy,
int speed)
setVelocity in class IMotiondx - -
change in x directiondy - -
change in y directionspeed - -
Timer delaypublic int getSpeed()
getSpeed in class IMotionpublic int getDX()
getDX in class IMotionpublic int getDY()
getDY in class IMotionpublic void timerReact()
timerReact in class IMotionpublic void start()
start in class IMotionpublic void stop()
stop in class IMotionpublic void bounce(CollisionObject co)
bounce in class IMotionco - a CollisionObject valuepublic void setDX(int dx)
setDX in class IMotionpublic void setDY(int dy)
setDY in class IMotion
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||