1 // SuperTux - MagicBlock
3 // Magic Blocks are tile-like game objects that are sensitive to
4 // lighting conditions. They are rendered in a color and
5 // will only be solid as long as light of the same color shines
6 // on the block. The black block becomes solid, if any kind of
7 // light is above MIN_INTENSITY.
9 // Copyright (C) 2006 Wolfgang Becker <uafr@gmx.de>
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef HEADER_SUPERTUX_OBJECT_MAGICBLOCK_HPP
25 #define HEADER_SUPERTUX_OBJECT_MAGICBLOCK_HPP
27 #include "object/moving_sprite.hpp"
29 class MagicBlock: public MovingSprite
32 MagicBlock(const Reader& reader);
34 bool collides(GameObject& other, const CollisionHit& hit);
35 HitResponse collision(GameObject& other, const CollisionHit& hit);
36 void update(float elapsed_time);
37 void draw(DrawingContext& context);
45 float switch_delay; /**< seconds until switching solidity */