com.planeth.gtroids.obj
Class Shot

java.lang.Object
  extended bycom.planeth.gtroids.obj.base.PaintableObject
      extended bycom.planeth.gtroids.obj.base.AbstractGameObject
          extended bycom.planeth.gtroids.obj.base.AbstractPhysicalObject
              extended bycom.planeth.gtroids.obj.base.AbstractAnimatedObject
                  extended bycom.planeth.gtroids.obj.Shot
All Implemented Interfaces:
ITimeControllable

public class Shot
extends AbstractAnimatedObject

A shot (bullet).

Author:
Andreas Grässer, gal@planet-h.com.
created May 30, 2005

Constructor Summary
Shot(int team)
          Constructor for Shot.
 
Method Summary
 void die()
          Initates the dead of the Object without any game relevant changes like updating healthPoints and updating players points
 void hitWith(AbstractGameObject abstractGameObject)
          Hits this object with the passed AbstractGameObject
 void initVelAndPos(Vector2D pos, Vector2D orientation, Vector2D gunBaseVel, double shotVel)
          Initialisiert das Geschoss (Position, Ausrichtung und Geschwindigkeit) Initializes the shot
protected  void update(double timeFactor, double speedFactor)
          Does one time and speed dependent update step for the Object
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractAnimatedObject
checkBorderJump, getCircumferentialVel, getLastPos, getRealTimeControl, getRotationVelDeg, getVel, isSpeedDependent, paint, pause, setBorderJumper, setCircumferentialVel, setRotationVelDeg, setSpeedDependent, setVel, update
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractPhysicalObject
getCenterOfMass, getElast, getExplodeSound, getGamePanel, getGravit, getObjectFactory, getQuadrantCoords, getVolume, hitWithBomb, isAffectingGame, setAffectingGame, setGamePanel, setGravit, setLifeTime, setQuadrantCoords, split
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractGameObject
cure, getAudioResource, getColorBackup, getStats, getTimerManager, initStats, isEnemy, isReadyToDie, kill, setColorBackup, setColorFixed, setReadyToDie
 
Methods inherited from class com.planeth.gtroids.obj.base.PaintableObject
addShape, explodeBaseShape, getAvgDiameter, getAvgVector, getBaseColor, getBaseVertexes, getBounds, getMaxRadius, getNrOfVertexes, getOrientation, getPos, move, paintAtPos, randomizeBaseShape, rotate, setBaseColor, splitBaseShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shot

public Shot(int team)
Constructor for Shot.

Parameters:
team - the team for the shot (should be the team of the firing gun)
Method Detail

initVelAndPos

public void initVelAndPos(Vector2D pos,
                          Vector2D orientation,
                          Vector2D gunBaseVel,
                          double shotVel)
Initialisiert das Geschoss (Position, Ausrichtung und Geschwindigkeit) Initializes the shot

Parameters:
pos - the position for the shot
orientation - the orientation for the shot
gunBaseVel - the base velocity for the shot (gun velocity)
shotVel - the shot velocity

hitWith

public void hitWith(AbstractGameObject abstractGameObject)
Description copied from class: AbstractGameObject
Hits this object with the passed AbstractGameObject

Overrides:
hitWith in class AbstractPhysicalObject
See Also:
AbstractGameObject.hitWith(com.planeth.gtroids.obj.base.AbstractGameObject)

die

public void die()
Description copied from class: AbstractGameObject
Initates the dead of the Object without any game relevant changes like updating healthPoints and updating players points

Overrides:
die in class AbstractPhysicalObject
See Also:
AbstractGameObject.die()

update

protected void update(double timeFactor,
                      double speedFactor)
Description copied from class: AbstractAnimatedObject
Does one time and speed dependent update step for the Object

Overrides:
update in class AbstractAnimatedObject
Parameters:
timeFactor - the timefactor which affects the stepsize
speedFactor - the speedfactor which affects the stepsize
See Also:
AbstractAnimatedObject.update(double, double)