moagg.model.object.sprite
Class Missile

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by com.golden.gamedev.object.AnimatedSprite
          extended by moagg.model.object.sprite.AbstractMoaggAnimatedSprite
              extended by moagg.model.object.sprite.Missile
All Implemented Interfaces:
java.io.Serializable, ControllableObject, DestroyableObject, MoaggGameObject, ShootableObject, ShootableWithWarheadObject

public class Missile
extends AbstractMoaggAnimatedSprite
implements MoaggGameObject, ShootableWithWarheadObject, ControllableObject, DestroyableObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.golden.gamedev.object.Sprite
defaultCollisionShape, height, width
 
Constructor Summary
Missile()
           
 
Method Summary
 void destroy()
          Calling this method will initiate the destruction of this object.
 double getAngle()
           
 int getDamage()
           
 long getFuel()
           
 long getFuelCapacity()
           
 long getFuelPerMilliSecond()
           
 int getHealth()
           
 long getMass()
           
 Rotation getRotation()
           
 double getRotationSpeed()
           
 int getScorePoints()
           
 ShooterObject getShooter()
           
 double getTargetAngle(double targetAngle, Vector g)
           
 double getThrustForce()
           
 Warhead getWarhead()
           
 boolean isAligned()
           
 boolean isDestroyableByProjectile()
           
 boolean isThrust()
           
 void setAngle(double angle)
           
 void setDamage(int damage)
           
 void setFuel(long fuel)
           
 void setFuelCapacity(long fuelCapacity)
           
 void setFuelPerMilliSecond(long fuelPerMilliSecond)
           
 void setHeading(MissileHeading heading)
           
 void setHealth(int health)
           
 void setMass(long mass)
           
 void setRotation(Rotation rotation)
           
 void setRotationSpeed(double rotationSpeed)
           
 void setShooter(ShooterObject shooter)
           
 void setThrust(boolean thrust)
           
 void setThrustForce(double thrustForce)
           
 void setWarhead(MissileWarhead warhead)
           
 void update(long elapsedTime)
           
 
Methods inherited from class moagg.model.object.sprite.AbstractMoaggAnimatedSprite
addSpeed, getPositionRectangle, getRGB, getSpeed, hide, isVisible, setRGB, setSpeed, setVisible, show
 
Methods inherited from class com.golden.gamedev.object.AnimatedSprite
getAnimationTimer, getFinishAnimationFrame, getFrame, getImage, getImage, getImages, getStartAnimationFrame, isAnimate, isLoopAnim, render, setAnimate, setAnimationFrame, setAnimationTimer, setFrame, setImage, setImages, setLoopAnim, updateAnimation
 
Methods inherited from class com.golden.gamedev.object.Sprite
addHorizontalSpeed, addVerticalSpeed, forceX, forceY, getBackground, getCenterX, getCenterY, getDataID, getDefaultCollisionShape, getDistance, getHeight, getHorizontalSpeed, getID, getLayer, getOldX, getOldY, getScreenX, getScreenY, getVerticalSpeed, getWidth, getX, getY, isActive, isImmutable, isOnScreen, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setBackground, setDataID, setHorizontalSpeed, setID, setImmutable, setLayer, setLocation, setMovement, setSpeed, setVerticalSpeed, setX, setY, updateMovement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Missile

public Missile()
Method Detail

getShooter

public ShooterObject getShooter()
Specified by:
getShooter in interface ShootableObject
Returns:
The ShooterObject that shooted this projectile.

setShooter

public void setShooter(ShooterObject shooter)

getDamage

public int getDamage()
Specified by:
getDamage in interface ShootableObject
Returns:
The damage points of this projectile.

setDamage

public void setDamage(int damage)
Specified by:
setDamage in interface ShootableObject
Parameters:
damage - The new damage points to set for this projectile.

isDestroyableByProjectile

public boolean isDestroyableByProjectile()
Specified by:
isDestroyableByProjectile in interface ShootableObject
Returns:
true, if this projectile can be destroyed by other projectiles, else false.

getAngle

public double getAngle()
Specified by:
getAngle in interface ControllableObject

setAngle

public void setAngle(double angle)
Specified by:
setAngle in interface ControllableObject

isThrust

public boolean isThrust()
Specified by:
isThrust in interface ControllableObject

setThrust

public void setThrust(boolean thrust)
Specified by:
setThrust in interface ControllableObject

getThrustForce

public double getThrustForce()
Specified by:
getThrustForce in interface ControllableObject

setThrustForce

public void setThrustForce(double thrustForce)
Specified by:
setThrustForce in interface ControllableObject

getMass

public long getMass()
Specified by:
getMass in interface ControllableObject

setMass

public void setMass(long mass)
Specified by:
setMass in interface ControllableObject

getFuelCapacity

public long getFuelCapacity()
Specified by:
getFuelCapacity in interface ControllableObject

setFuelCapacity

public void setFuelCapacity(long fuelCapacity)
Specified by:
setFuelCapacity in interface ControllableObject

getFuel

public long getFuel()
Specified by:
getFuel in interface ControllableObject

setFuel

public void setFuel(long fuel)
Specified by:
setFuel in interface ControllableObject

getFuelPerMilliSecond

public long getFuelPerMilliSecond()
Specified by:
getFuelPerMilliSecond in interface ControllableObject

setFuelPerMilliSecond

public void setFuelPerMilliSecond(long fuelPerMilliSecond)
Specified by:
setFuelPerMilliSecond in interface ControllableObject

getRotation

public Rotation getRotation()
Specified by:
getRotation in interface ControllableObject

setRotation

public void setRotation(Rotation rotation)
Specified by:
setRotation in interface ControllableObject

isAligned

public boolean isAligned()
Specified by:
isAligned in interface ControllableObject

getRotationSpeed

public double getRotationSpeed()
Specified by:
getRotationSpeed in interface ControllableObject

setRotationSpeed

public void setRotationSpeed(double rotationSpeed)
Specified by:
setRotationSpeed in interface ControllableObject

getHealth

public int getHealth()
Specified by:
getHealth in interface DestroyableObject
Returns:
The current health points of this object.

setHealth

public void setHealth(int health)
Specified by:
setHealth in interface DestroyableObject
Parameters:
health - The new amount of health points to set for this object.

destroy

public void destroy()
Description copied from interface: DestroyableObject
Calling this method will initiate the destruction of this object.

Specified by:
destroy in interface DestroyableObject

getScorePoints

public int getScorePoints()
Specified by:
getScorePoints in interface DestroyableObject
Returns:
The points that shall be added to the player's score.

setHeading

public void setHeading(MissileHeading heading)

getTargetAngle

public double getTargetAngle(double targetAngle,
                             Vector g)

setWarhead

public void setWarhead(MissileWarhead warhead)

getWarhead

public Warhead getWarhead()
Specified by:
getWarhead in interface ShootableWithWarheadObject

update

public void update(long elapsedTime)
Overrides:
update in class com.golden.gamedev.object.AnimatedSprite


Copyright © 2008. All Rights Reserved.