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