X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.hpp;h=3979dd19ea52ebdeb030da4ed25ebb70f978a82d;hb=788a9153f60fb3d25a52fd184387ebbde7636719;hp=ab45abcf0151ce8882ffd3fde00694f98c094bd9;hpb=f8a4dbe2c664797922d2aa4eaac411bc8746921b;p=supertux.git diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index ab45abcf0..3979dd19e 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -1,8 +1,8 @@ // $Id$ -// +// // Zeekling - flyer that swoops down when she spots the player // Copyright (C) 2005 Matthias Braun -// Copyright (C) 2006 Christoph Sommer +// 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 @@ -13,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 @@ -28,17 +28,17 @@ 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 initialize(); 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; + bool collision_squished(GameObject& object); float speed; Timer diveRecoverTimer; @@ -51,11 +51,13 @@ protected: ZeeklingState state; private: + const MovingObject* last_player; /**< last player we tracked */ + Vector last_player_pos; /**< position we last spotted the player at */ + Vector last_self_pos; /**< position we last were at */ + bool should_we_dive(); void onBumpHorizontal(); void onBumpVertical(); - }; #endif -