00001 // SuperTux - MagicBlock 00002 // 00003 // Magic Blocks are tile-like game objects that are sensitive to 00004 // lighting conditions. They are rendered in a color and 00005 // will only be solid as long as light of the same color shines 00006 // on the block. The black block becomes solid, if any kind of 00007 // light is above MIN_INTENSITY. 00008 // 00009 // Copyright (C) 2006 Wolfgang Becker <uafr@gmx.de> 00010 // 00011 // This program is free software: you can redistribute it and/or modify 00012 // it under the terms of the GNU General Public License as published by 00013 // the Free Software Foundation, either version 3 of the License, or 00014 // (at your option) any later version. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00023 00024 #ifndef HEADER_SUPERTUX_OBJECT_MAGICBLOCK_HPP 00025 #define HEADER_SUPERTUX_OBJECT_MAGICBLOCK_HPP 00026 00027 #include "object/moving_sprite.hpp" 00028 00029 class MagicBlock: public MovingSprite 00030 { 00031 public: 00032 MagicBlock(const Reader& reader); 00033 00034 bool collides(GameObject& other, const CollisionHit& hit); 00035 HitResponse collision(GameObject& other, const CollisionHit& hit); 00036 void update(float elapsed_time); 00037 void draw(DrawingContext& context); 00038 00039 private: 00040 bool is_solid; 00041 float trigger_red; 00042 float trigger_green; 00043 float trigger_blue; 00044 float solid_time; 00045 float switch_delay; 00046 Color color; 00047 Color light; 00048 Vector center; 00049 bool black; 00050 }; 00051 00052 #endif 00053 00054 /* EOF */