1 | // SuperTux |
2 | // Copyright (C) 2006 Matthias Braun <matze@braunis.de> |
3 | // |
4 | // This program is free software: you can redistribute it and/or modify |
5 | // it under the terms of the GNU General Public License as published by |
6 | // the Free Software Foundation, either version 3 of the License, or |
7 | // (at your option) any later version. |
8 | // |
9 | // This program is distributed in the hope that it will be useful, |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | // GNU General Public License for more details. |
13 | // |
14 | // You should have received a copy of the GNU General Public License |
15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | |
17 | #ifndef HEADER_SUPERTUX_OBJECT_SPOTLIGHT_HPP |
18 | #define |
19 | |
20 | #include "sprite/sprite_ptr.hpp" |
21 | #include "supertux/moving_object.hpp" |
22 | #include "video/color.hpp" |
23 | |
24 | class ReaderMapping; |
25 | |
26 | class Spotlight final : public MovingObject |
27 | { |
28 | public: |
29 | Spotlight(const ReaderMapping& reader); |
30 | virtual ~Spotlight(); |
31 | |
32 | virtual void update(float dt_sec) override; |
33 | virtual void draw(DrawingContext& context) override; |
34 | |
35 | virtual HitResponse collision(GameObject& other, const CollisionHit& hit_) override; |
36 | |
37 | virtual std::string get_class() const override { return "spotlight" ; } |
38 | virtual std::string get_display_name() const override { return _("Spotlight" ); } |
39 | |
40 | virtual ObjectSettings get_settings() override; |
41 | |
42 | private: |
43 | float angle; |
44 | SpritePtr center; |
45 | SpritePtr base; |
46 | SpritePtr lights; |
47 | SpritePtr light; |
48 | SpritePtr lightcone; |
49 | |
50 | Color color; |
51 | |
52 | /** Speed that the spotlight is rotating with */ |
53 | float speed; |
54 | |
55 | /** If true, the spotlight will rotate counter-clockwise */ |
56 | bool counter_clockwise; |
57 | |
58 | private: |
59 | Spotlight(const Spotlight&) = delete; |
60 | Spotlight& operator=(const Spotlight&) = delete; |
61 | }; |
62 | |
63 | #endif |
64 | |
65 | /* EOF */ |
66 | |