1// SuperTux
2// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18#ifndef HEADER_SUPERTUX_OBJECT_SPRITE_PARTICLE_HPP
19#define HEADER_SUPERTUX_OBJECT_SPRITE_PARTICLE_HPP
20
21#include "math/anchor_point.hpp"
22#include "sprite/sprite_ptr.hpp"
23#include "supertux/game_object.hpp"
24#include "video/drawing_context.hpp"
25
26class Player;
27
28class SpriteParticle final : public GameObject
29{
30public:
31 SpriteParticle(SpritePtr sprite, const std::string& action,
32 const Vector& position, AnchorPoint anchor,
33 const Vector& velocity, const Vector& acceleration,
34 int drawing_layer = LAYER_OBJECTS-1);
35 SpriteParticle(const std::string& sprite_name, const std::string& action,
36 const Vector& position, AnchorPoint anchor,
37 const Vector& velocity, const Vector& acceleration,
38 int drawing_layer = LAYER_OBJECTS-1);
39 ~SpriteParticle();
40
41protected:
42 virtual void update(float dt_sec) override;
43 virtual void draw(DrawingContext& context) override;
44 virtual bool is_saveable() const override {
45 return false;
46 }
47
48private:
49 SpritePtr sprite;
50 Vector position;
51 Vector velocity;
52 Vector acceleration;
53 int drawing_layer;
54 SpritePtr lightsprite;
55 bool glow;
56
57private:
58 SpriteParticle(const SpriteParticle&) = delete;
59 SpriteParticle& operator=(const SpriteParticle&) = delete;
60};
61
62#endif
63
64/* EOF */
65