|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphysics.IMotion
physics.StraightMotion
public class StraightMotion
StraightMotion.java Created: Sat Sep 18 20:30:34 2004
| Constructor Summary | |
|---|---|
StraightMotion(CollisionObject colOb)
Creates a new StraightMotion instance. |
|
| Method Summary | |
|---|---|
void |
bounce(CollisionObject col)
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)
Sets the DX of the motion |
void |
setDY(int dy)
Sets the DY of the motion |
void |
setTimer(MotionTimer mt)
Sets the MotionTimer for this motion |
void |
setVelocity(int dx,
int dy,
int speed)
Sets the velocity of the motion |
void |
start()
Starts the MotionTimer for this motion |
void |
stillCollide(CollisionObject col)
Check to see if the object with this motion and col are still colliding and if so move them apart |
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, setGravity, setLocation, switchMomentum |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StraightMotion(CollisionObject colOb)
StraightMotion instance.
colOb - a CollisionObject value| Method Detail |
|---|
public void setVelocity(int dx,
int dy,
int speed)
setVelocity in class IMotiondx - an int valuedy - an int valuespeed - an int valuepublic void setDX(int dx)
setDX in class IMotiondx - an int valuespeed - an int valuepublic void setDY(int dy)
setDY in class IMotiondy - an int valuespeed - an int valuepublic int getSpeed()
getSpeed in class IMotionint valuepublic int getDX()
getDX in class IMotionint valuepublic int getDY()
getDY in class IMotionint valuepublic void timerReact()
timerReact in class IMotionpublic void setTimer(MotionTimer mt)
public void start()
start in class IMotionpublic void stop()
stop in class IMotionpublic void bounce(CollisionObject col)
bounce in class IMotioncol - a CollisionObject valuepublic void stillCollide(CollisionObject col)
col - a CollisionObject value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||