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 "util/reader_fwd.hpp"
25 #include "math/vector.hpp"
26 #include "supertux/game_object.hpp"
32 class SpriteChange : public GameObject
35 SpriteChange(const Reader& lisp);
36 virtual ~SpriteChange();
38 virtual void draw(DrawingContext& context);
39 virtual void update(float elapsed_time);
42 * Activates the SpriteChange's stay action, if applicable
44 void set_stay_action();
47 * Deactivates the SpriteChange's stay action, if applicable
49 void clear_stay_action();
54 /** should tuxs sprite change when the tile has been completely entered,
55 or already when the tile was just touched */
58 /** sprite to change tux image to */
59 std::auto_ptr<Sprite> sprite;
61 /** stay action can be used for objects like boats or cars, if it is
62 != "" then this sprite will be displayed when tux left the tile
63 towards another SpriteChange object. */
64 std::string stay_action;
66 /** name of a group in which only one SpriteChange will ever have
67 its stay_action displayed. Leave empty if you don't care. */
68 std::string stay_group;
71 /** should the stayaction be displayed */
75 static std::list<SpriteChange*> all_sprite_changes;
78 } // namespace worldmap