physics
Class IMotion

java.lang.Object
  extended by physics.IMotion
Direct Known Subclasses:
FrictionMotion, GravityMotion, NullMotion, StraightMotion

public abstract class IMotion
extends Object

IMotion.java Created: Saturday September 18 11:45:51 2004

Version:
An abstract class for the motion of a CollisionObject
Author:

Constructor Summary
IMotion()
           
 
Method Summary
abstract  void bounce(CollisionObject col)
          Override to create a bounce for this motion when it collides with col
 void changeMomentum(double d)
          Override to do something useful
 boolean getCollided()
          Returns true, override to do something useful
abstract  int getDX()
          Should return the DX value
abstract  int getDY()
          Should return the DY value
abstract  int getSpeed()
          Should return the speed of this motion
 double getVelocity()
          Override to do something useful
 void setCoefficient(double c)
          Override to do something useful
 void setDX(double d)
          Override to do something useful
abstract  void setDX(int dx)
          Should change the DX value
 void setDY(double d)
          Override to do something useful
abstract  void setDY(int dy)
          Should change the DY value
 void setGravity(int g)
          Override to do something useful
 void setLocation(double d, double d2)
          Override to do something useful
abstract  void setVelocity(int dx, int dy, int speed)
          Set the velocity of this motion
abstract  void start()
          Should start the timer of this motion
abstract  void stop()
          Should stop the timer of this motion
 void switchMomentum(double d, CollisionObject c)
          Override to do something useful
abstract  void timerReact()
          Called when the timer reacts Should be overridden to do something useful
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IMotion

public IMotion()
Method Detail

setVelocity

public abstract void setVelocity(int dx,
                                 int dy,
                                 int speed)
Set the velocity of this motion

Parameters:
dx- - change in the x direction
dy - - change in the y direction
speed - - the timer delay

getDX

public abstract int getDX()
Should return the DX value

Returns:
change in the x direction

setDX

public abstract void setDX(int dx)
Should change the DX value


setDY

public abstract void setDY(int dy)
Should change the DY value


getDY

public abstract int getDY()
Should return the DY value

Returns:
change in the y direction

getSpeed

public abstract int getSpeed()
Should return the speed of this motion

Returns:
the timer delay

timerReact

public abstract void timerReact()
Called when the timer reacts Should be overridden to do something useful


start

public abstract void start()
Should start the timer of this motion


stop

public abstract void stop()
Should stop the timer of this motion


bounce

public abstract void bounce(CollisionObject col)
Override to create a bounce for this motion when it collides with col

Parameters:
col - a CollisionObject value

setCoefficient

public void setCoefficient(double c)
Override to do something useful

Parameters:
c - a double value

getVelocity

public double getVelocity()
Override to do something useful

Returns:
a double value

changeMomentum

public void changeMomentum(double d)
Override to do something useful

Parameters:
d - a double value

switchMomentum

public void switchMomentum(double d,
                           CollisionObject c)
Override to do something useful

Parameters:
d - a double value
c - a CollisionObject value

getCollided

public boolean getCollided()
Returns true, override to do something useful

Returns:
a boolean value

setDX

public void setDX(double d)
Override to do something useful

Parameters:
d - a double value

setDY

public void setDY(double d)
Override to do something useful

Parameters:
d - a double value

setLocation

public void setLocation(double d,
                        double d2)
Override to do something useful

Parameters:
d - a double value
d2 - a double value

setGravity

public void setGravity(int g)
Override to do something useful

Parameters:
g - an int value