X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.hpp;h=3979dd19ea52ebdeb030da4ed25ebb70f978a82d;hb=013a5ca196545a094f27c1b708facd0084d58d55;hp=fd0f2871b02d36d6de0fca87b53f923f507961f0;hpb=a113d3bd1feddd510e3b2852b0d42522735eee40;p=supertux.git diff --git a/src/badguy/zeekling.hpp b/src/badguy/zeekling.hpp index fd0f2871b..3979dd19e 100644 --- a/src/badguy/zeekling.hpp +++ b/src/badguy/zeekling.hpp @@ -2,7 +2,7 @@ // // 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 @@ -30,7 +30,7 @@ public: Zeekling(const lisp::Lisp& reader); Zeekling(const Vector& pos, Direction d); - void activate(); + void initialize(); void write(lisp::Writer& writer); void collision_solid(const CollisionHit& hit); void active_update(float elapsed_time); @@ -38,7 +38,7 @@ public: virtual Zeekling* clone() const { return new Zeekling(*this); } protected: - bool collision_squished(Player& player); + bool collision_squished(GameObject& object); float speed; Timer diveRecoverTimer; @@ -51,6 +51,10 @@ 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();