Reduced switching delay from 1s to 0.1s
[supertux.git] / src / object / magicblock.hpp
1 //  $Id$
2 //
3 //  SuperTux - MagicBlock
4 // 
5 //  Magic Blocks are tile-like game objects that are sensitive to 
6 //  lighting conditions. They are rendered in a color and
7 //  will only be solid as long as light of the same color shines
8 //  on the block.
9 //
10 //  Copyright (C) 2006 Wolfgang Becker <uafr@gmx.de>
11 //
12 //  This program is free software; you can redistribute it and/or
13 //  modify it under the terms of the GNU General Public License
14 //  as published by the Free Software Foundation; either version 2
15 //  of the License, or (at your option) any later version.
16 //
17 //  This program is distributed in the hope that it will be useful,
18 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 //  GNU General Public License for more details.
21 //
22 //  You should have received a copy of the GNU General Public License
23 //  along with this program; if not, write to the Free Software
24 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
26 #ifndef SUPERTUX_TRAMPOLINE_H
27 #define SUPERTUX_TRAMPOLINE_H
28
29 #include "moving_sprite.hpp"
30 #include "lisp/lisp.hpp"
31
32 class MagicBlock: public MovingSprite
33 {
34 public:
35   MagicBlock(const lisp::Lisp& reader);
36
37   HitResponse collision(GameObject& other, const CollisionHit& hit);
38   void update(float elapsed_time);
39   void draw(DrawingContext& context);
40
41 private:
42   bool is_solid;
43   float trigger_red;
44   float trigger_green;
45   float trigger_blue;
46   float solid_time;
47   float switch_delay; /**< seconds until switching solidity */
48   Color color;
49   Color light;
50   Vector center;
51 };
52
53 #endif