28 virtual void SetAnimation(Animation *pAnimation) { m_pAnimation = pAnimation; }
32 virtual void Update(
const GameTime *pGameTime);
36 virtual void Draw(SpriteBatch *pSpriteBatch);
41 virtual void Activate(
const Vector2 &position,
bool wasShotByPlayer =
true);
45 virtual void SetEmitter(Emitter *pEmitter) { m_pEmitter = pEmitter; }
49 virtual std::string
ToString()
const {
return "Missile"; }
56 void SetTurnSpeed(
const float turnSpeed) { m_turnSpeed = Math::Abs(turnSpeed); }
60 void SetRange(
const float range) { m_range = range; }
64 void SetAngle(
const float angle) { m_angle = angle; }
68 void SetTarget(GameObject *pTarget =
nullptr) { m_pTarget = pTarget; }
80 Animation *m_pAnimation;
82 int m_targetingDelayFrames;
84 Vector2 m_targetingOffset;
90 GameObject *m_pTarget;
virtual std::string ToString() const
Gets a string representation of the missile.
Definition: Missile.h:49
Sample is a sample game to use as a template for using Katana Engine and Shooter Library.
Definition: Background.cpp:14
virtual void Draw(SpriteBatch *pSpriteBatch)
Called when the game determines it is time to draw a frame.
Definition: Missile.cpp:78
virtual void SetAnimation(Animation *pAnimation)
Sets the animation for the missile.
Definition: Missile.h:28
virtual void SetEmitter(Emitter *pEmitter)
Sets the particle emitter for particle trail.
Definition: Missile.h:45
virtual void Update(const GameTime *pGameTime)
Called when the game determines it is time to draw a frame.
Definition: Missile.cpp:27
void SetAngle(const float angle)
Sets the current angle of the missile.
Definition: Missile.h:64
Class for missiles.
Definition: Missile.h:18
void SetTurnSpeed(const float turnSpeed)
Sets the turn speed of the missile.
Definition: Missile.h:56
Base class for all projectile types.
Definition: Projectile.h:20
void SetRange(const float range)
Sets the target range of the missile.
Definition: Missile.h:60
GameObject * GetTarget() const
Gets the missile's target object.
Definition: Missile.h:75
void ResetTargetingDelay()
Resets the timer for when the missile should reaquire a target.
Definition: Missile.h:71
void SetTarget(GameObject *pTarget=nullptr)
Sets the missile's target.
Definition: Missile.h:68
virtual void Activate()
Activates the game object.
Definition: GameObject.h:71