TileId& shape;
};
-class FloatingScore : public GameObject
+class FloatingText : public GameObject
{
public:
- FloatingScore(const Vector& pos, int s);
+ FloatingText(const Vector& pos, std::string& text_);
+ FloatingText(const Vector& pos, int s); // use this for score, for instance
virtual void action(float elapsed_time);
virtual void draw(DrawingContext& context);
private:
Vector position;
- char str[10];
+ std::string text;
Timer timer;
};
class Particles : public GameObject
{
public:
- Particles(const Vector& epicenter, int number, Color color, int size, float velocity, int life_time);
+ Particles(const Vector& epicenter, const Vector& velocity, const Vector& acceleration, int number, Color color, int size, int life_time);
~Particles();
virtual void action(float elapsed_time);
private:
Color color;
float size;
- float velocity;
+ Vector vel, accel;
Timer timer;
+ bool live_forever;
struct Particle {
Vector pos;