2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
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.
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.
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/>.
17 #ifndef HEADER_SUPERTUX_WORLDMAP_SPRITE_CHANGE_HPP
18 #define HEADER_SUPERTUX_WORLDMAP_SPRITE_CHANGE_HPP
24 #include "lisp/lisp.hpp"
25 #include "math/vector.hpp"
26 #include "supertux/game_object.hpp"
30 namespace WorldMapNS {
32 class SpriteChange : public GameObject
35 SpriteChange(const lisp::Lisp* lisp);
36 virtual ~SpriteChange();
40 * should tuxs sprite change when the tile has been completely entered,
41 * or already when the tile was just touched
44 /// sprite to change tux image to
45 std::auto_ptr<Sprite> sprite;
47 * stay action can be used for objects like boats or cars, if it is
48 * != "" then this sprite will be displayed when tux left the tile towards
49 * another SpriteChange object.
51 std::string stay_action;
54 * name of a group in which only one SpriteChange will ever have its stay_action displayed.
55 * Leave empty if you don't care.
57 std::string stay_group;
59 virtual void draw(DrawingContext& context);
60 virtual void update(float elapsed_time);
63 * Activates the SpriteChange's stay action, if applicable
65 void set_stay_action();
68 * Deactivates the SpriteChange's stay action, if applicable
70 void clear_stay_action();
74 * should the stayaction be displayed
78 static std::list<SpriteChange*> all_sprite_changes;