27 lines
508 B
C++
27 lines
508 B
C++
#pragma once
|
|
#include "Texture.h"
|
|
|
|
class Particle {
|
|
public:
|
|
Particle() = default;
|
|
Particle(const Vector2f& pos, const Vector2f& velocity, const Vector2f& gravity, float lifetime, Texture* pTexture);
|
|
~Particle() = default;
|
|
|
|
void Update(float elapsedSec);
|
|
void Draw() const;
|
|
bool IsDead() const;
|
|
void SetFlipped(bool flipped);
|
|
|
|
private:
|
|
Vector2f m_Position;
|
|
Vector2f m_Velocity;
|
|
Vector2f m_Acceleration;
|
|
|
|
Vector2f m_Gravity;
|
|
|
|
bool m_Flipped{ false };
|
|
float m_LifeTime;
|
|
|
|
Texture* m_pTexture;
|
|
};
|