5Texture *Projectile::s_pTexture =
nullptr;
44 m_wasShotByPlayer = wasShotByPlayer;
52 return std::string((
WasShotByPlayer()) ?
"Player" :
"Enemy").append(
" Projectile");
Represents a type of collision.
static const CollisionType Enemy
static const CollisionType Player
virtual void TranslatePosition(const float x, const float y)
virtual void SetPosition(const float x, const float y)
virtual void SetCollisionRadius(const int radius)
virtual void Activate()
Activate the object.
virtual bool IsActive() const
Flag to determine if the object is active.
virtual void Deactivate()
Deactivate the object.
static Level * GetCurrentLevel()
Get the current level.
virtual void Update(const GameTime &gameTime)
Update the object.
virtual Vector2 & GetPosition()
Get the position of the object.
static const Color White
White.
static int GetScreenHeight()
Gets the screen width in pixels.
static int GetScreenWidth()
Gets the screen width in pixels.
Contains timing values for game updates and rendering.
double GetElapsedTime() const
Gets the time in seconds since last frame.
Enables a group of sprites to be drawn using the same settings.
void Draw(const Texture *pTexture, const Vector2 position, const Region region, const Color color=Color::White, const Vector2 origin=Vector2::ZERO, const Vector2 scale=Vector2::ONE, const float rotation=0, const float drawDepth=0)
Adds a sprite to a batch of sprites to be rendered.
Represents a 2D grid of texels.
Vector2 GetCenter() const
Gets the center position of the texture.
Vector2 GetSize() const
Gets the dimensions of the texture.
Defines a vector with 2 components (x and y).
float Y
The y-coordinate of the vector.
static const Vector2 UNIT_Y
A unit vector on the y-axis.
float X
The x-coordinate of the vector.
virtual float GetAlpha() const
Get the alpha value of the screen.
virtual CollisionType GetProjectileType() const
Get the collision type of the projectile.
virtual CollisionType GetCollisionType() const
Get the type of collision the projectile will have.
virtual bool WasShotByPlayer() const
Determine if the projectile was fired by the player.
virtual void SetDirection(const Vector2 direction)
Set the direction of the projectile.
Projectile()
Instantiate a projectile object.
virtual std::string ToString() const
Get the string representation of the projectile.
virtual void Draw(SpriteBatch &spriteBatch)
Render the projectile.
virtual void Update(const GameTime &gameTime)
Update the projectile.