cc6a7a005861465de83d8a96ae7bd2503bbc4d33
[supertux.git] / src / object / electrifier.hpp
1 //  SuperTux
2 //
3 //  This program is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU General Public License
5 //  as published by the Free Software Foundation; either version 2
6 //  of the License, or (at your option) any later version.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU General Public License for more details.
12 // 
13 //  You should have received a copy of the GNU General Public License
14 //  along with this program; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 //  02111-1307, USA.
17
18 #ifndef __ELECTRIFIER_H__
19 #define __ELECTRIFIER_H__
20
21 #include "game_object.hpp"
22 #include "timer.hpp"
23
24 //Changes all tiles with the given ID to a new one for a given amount of time, then removes itself
25 //Used by the Kugelblitz to electrify water - can be used for other effects, too
26 class Electrifier : public GameObject
27 {
28 public:
29   Electrifier(uint32_t oldtile, uint32_t newtile, float seconds);
30   ~Electrifier();
31 protected:  
32   virtual void update(float time);
33   virtual void draw(DrawingContext& context);
34 private:
35   uint32_t change_from;
36   uint32_t change_to;
37   Timer duration;
38 };
39
40 #endif
41