fixed electrifier
[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 <config.h>
22 #include "resources.hpp"
23 #include "game_object.hpp"
24 #include "timer.hpp"
25
26 //Changes all tiles with the given ID to a new one for a given amount of time, then removes itself
27 //Used by the Kugelblitz to electrify water - can be used for other effects, too
28 class Electrifier : public GameObject
29 {
30 public:
31   Electrifier(uint32_t oldtile, uint32_t newtile, float seconds);
32   ~Electrifier();
33 protected:  
34   virtual void update(float time);
35   virtual void draw(DrawingContext& context);
36 private:
37   uint32_t change_from;
38   uint32_t change_to;
39   Timer duration;
40 };
41
42 #endif
43