00001 // SuperTux - Weak Block 00002 // Copyright (C) 2006 Matthias Braun <matze@braunis.de> 00003 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de> 00004 // 00005 // This program is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 00018 #ifndef HEADER_SUPERTUX_OBJECT_WEAK_BLOCK_HPP 00019 #define HEADER_SUPERTUX_OBJECT_WEAK_BLOCK_HPP 00020 00021 #include "object/moving_sprite.hpp" 00022 #include "supertux/physic.hpp" 00023 00027 class WeakBlock : public MovingSprite 00028 { 00029 public: 00030 WeakBlock(const Reader& lisp); 00031 00032 HitResponse collision(GameObject& other, const CollisionHit& hit); 00033 void update(float elapsed_time); 00034 00035 protected: 00039 void startBurning(); 00040 00044 void spreadHit(); 00045 00046 private: 00047 enum State { 00048 STATE_NORMAL, 00049 STATE_BURNING, 00050 STATE_DISINTEGRATING 00051 }; 00052 State state; 00053 }; 00054 00055 #endif 00056 00057 /* EOF */