3 // IceCrusher - A block to stand on, which can drop down to crush the player
4 // Copyright (C) 2008 Christoph Sommer <christoph.sommer@2008.expires.deltadevelopment.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (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, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 #ifndef INCLUDED_ICECRUSHER_HPP
22 #define INCLUDED_ICECRUSHER_HPP
26 #include "object/moving_sprite.hpp"
27 #include "object/player.hpp"
30 * This class is the base class for icecrushers that tux can stand on
32 class IceCrusher : public MovingSprite
35 IceCrusher(const lisp::Lisp& reader);
36 IceCrusher(const IceCrusher& icecrusher);
37 virtual IceCrusher* clone() const { return new IceCrusher(*this); }
39 virtual HitResponse collision(GameObject& other, const CollisionHit& hit);
40 virtual void collision_solid(const CollisionHit& hit);
41 virtual void update(float elapsed_time);
43 const Vector& get_speed() const
49 enum IceCrusherState {
54 IceCrusherState state;
55 Vector start_position;
58 Player* get_nearest_player();
60 void set_state(IceCrusherState state, bool force = false);