X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fsnail.hpp;h=6e5471ac106fb7ba8304a282ddb7edf84ebb0ffa;hb=12a28b64dcce9c7ff706451b4f3aecd201cc8a5f;hp=0e804090e9237d8b59041e9660ed54991826f0a2;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/badguy/snail.hpp b/src/badguy/snail.hpp index 0e804090e..6e5471ac1 100644 --- a/src/badguy/snail.hpp +++ b/src/badguy/snail.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux - Badguy "Snail" // Copyright (C) 2006 Christoph Sommer // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,13 +12,12 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// along with this program. If not, see . -#ifndef __SNAIL_H__ -#define __SNAIL_H__ +#ifndef HEADER_SUPERTUX_BADGUY_SNAIL_HPP +#define HEADER_SUPERTUX_BADGUY_SNAIL_HPP -#include "walking_badguy.hpp" +#include "badguy/walking_badguy.hpp" /** * Badguy "Snail" - a snail-like creature that can be flipped and tossed around at an angle @@ -28,21 +25,18 @@ class Snail : public WalkingBadguy { public: - Snail(const lisp::Lisp& reader); + Snail(const Reader& reader); Snail(const Vector& pos, Direction d); - void activate(); - void write(lisp::Writer& writer); + void initialize(); void collision_solid(const CollisionHit& hit); HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); bool can_break(); void active_update(float elapsed_time); - virtual Snail* clone() const { return new Snail(*this); } - protected: - bool collision_squished(Player& player); + bool collision_squished(GameObject& object); void be_normal(); /**< switch to state STATE_NORMAL */ void be_flat(); /**< switch to state STATE_FLAT */ void be_kicked(); /**< switch to state STATE_KICKED_DELAY */ @@ -54,10 +48,14 @@ private: STATE_KICKED_DELAY, /**< short delay before being launched */ STATE_KICKED /**< launched */ }; + +private: State state; Timer flat_timer; /**< wait time until flipping right-side-up again */ Timer kicked_delay_timer; /**< wait time until switching from STATE_KICKED_DELAY to STATE_KICKED */ - int squishcount; + int squishcount; }; #endif + +/* EOF */