1 // SuperTux - Unstable Tile
2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
4 // Copyright (C) 2010 Florian Forster <supertux at octo.it>
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef HEADER_SUPERTUX_OBJECT_UNSTABLE_TILE_HPP
20 #define HEADER_SUPERTUX_OBJECT_UNSTABLE_TILE_HPP
22 #include "object/moving_sprite.hpp"
23 #include "supertux/physic.hpp"
24 #include "supertux/timer.hpp"
27 * A block that disintegrates when stood on
29 class UnstableTile : public MovingSprite
32 UnstableTile(const Reader& lisp);
34 HitResponse collision(GameObject& other, const CollisionHit& hit);
35 void update(float elapsed_time);
39 STATE_NORMAL, /**< default state */
40 STATE_SHAKE, /**< shaking, still solid */
41 STATE_DISSOLVE, /**< dissolving, will turn non-solid after this */
42 STATE_SLOWFALL, /**< slow fall phase (used when neither shaking nor dissolving exist */
43 STATE_FALL /**< falling down */
46 void startCrumbling();
51 void fall_down (void);
52 void slow_fall (void);