X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.hpp;h=178423703f26137df33b118b184de520a848d50b;hb=126aa9428c83eb1e17d4a75a55d15e3e6e0c6875;hp=7dc18af73c5e12412d74581ed344db5c98a4f9f4;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index 7dc18af73..178423703 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -1,7 +1,8 @@ // $Id$ -// -// SuperTux +// +// Zeekling - flyer that swoops down when she spots the player // Copyright (C) 2005 Matthias Braun +// 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 @@ -12,7 +13,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 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 @@ -27,17 +28,32 @@ class Zeekling : public BadGuy { public: Zeekling(const lisp::Lisp& reader); - Zeekling(float pos_x, float pos_y, Direction d); + Zeekling(const Vector& pos, Direction d); void activate(); void write(lisp::Writer& writer); - HitResponse collision_solid(GameObject& other, const CollisionHit& hit); + void collision_solid(const CollisionHit& hit); + void active_update(float elapsed_time); + + virtual Zeekling* clone() const { return new Zeekling(*this); } protected: bool collision_squished(Player& player); - bool set_direction; - Direction initial_direction; float speed; + + Timer diveRecoverTimer; + + enum ZeeklingState { + FLYING, + DIVING, + CLIMBING + }; + ZeeklingState state; + +private: + bool should_we_dive(); + void onBumpHorizontal(); + void onBumpVertical(); }; #endif