|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object physics.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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StraightMotion(CollisionObject colOb)
StraightMotion
instance.
colOb
- a CollisionObject
valueMethod Detail |
---|
public void setVelocity(int dx, int dy, int speed)
setVelocity
in class IMotion
dx
- an int
valuedy
- an int
valuespeed
- an int
valuepublic void setDX(int dx)
setDX
in class IMotion
dx
- an int
valuespeed
- an int
valuepublic void setDY(int dy)
setDY
in class IMotion
dy
- an int
valuespeed
- an int
valuepublic int getSpeed()
getSpeed
in class IMotion
int
valuepublic int getDX()
getDX
in class IMotion
int
valuepublic int getDY()
getDY
in class IMotion
int
valuepublic void timerReact()
timerReact
in class IMotion
public void setTimer(MotionTimer mt)
public void start()
start
in class IMotion
public void stop()
stop
in class IMotion
public void bounce(CollisionObject col)
bounce
in class IMotion
col
- 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 |