3 // SuperTux - PneumaticPlatform
4 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.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 02111-1307, USA.
20 #ifndef __PNEUMATIC_PLATFORM_H__
21 #define __PNEUMATIC_PLATFORM_H__
26 #include "object/moving_sprite.hpp"
27 #include "object/path.hpp"
28 #include "object/path_walker.hpp"
31 * Used to construct a pair of pneumatic platforms: If one is pushed down, the other one rises
33 class PneumaticPlatform : public MovingSprite
36 PneumaticPlatform(const lisp::Lisp& reader);
37 PneumaticPlatform(PneumaticPlatform* master);
38 virtual ~PneumaticPlatform();
40 virtual HitResponse collision(GameObject& other, const CollisionHit& hit);
41 virtual void update(float elapsed_time);
44 PneumaticPlatform* master; /**< pointer to PneumaticPlatform that does movement calculation */
45 PneumaticPlatform* slave; /**< pointer to PneumaticPlatform that reacts to master platform's movement calculation */
46 float start_y; /**< vertical start position */
47 float offset_y; /**< vertical offset from the start position in px */
48 float speed_y; /**< vertical speed */
49 std::set<GameObject*> contacts; /**< objects that are currently pushing on the platform */