X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Figel.hpp;h=4d2b82f793c128d655ad40a065ed26372aeb7414;hb=2d1bc69993923150eb701d3cacb917ab4e23d5ef;hp=14b8ee50ab1326c0aab5dda2dc461357bbc77f6b;hpb=be79a2085027d3c990b621d1cf58fafaba1bcc67;p=supertux.git diff --git a/src/badguy/igel.hpp b/src/badguy/igel.hpp index 14b8ee50a..4d2b82f79 100644 --- a/src/badguy/igel.hpp +++ b/src/badguy/igel.hpp @@ -1,4 +1,4 @@ -// $Id: igel.hpp 3452 2006-04-27 18:19:15Z sommer $ +// $Id$ // // SuperTux - Badguy "Igel" // Copyright (C) 2006 Christoph Sommer @@ -20,41 +20,34 @@ #ifndef __IGEL_H__ #define __IGEL_H__ -#include "badguy.hpp" +#include "walking_badguy.hpp" #include "moving_object.hpp" /** * Badguy "Igel" - a hedgehog that can absorb bullets */ -class Igel : public BadGuy +class Igel : public WalkingBadguy { public: Igel(const lisp::Lisp& reader); - Igel(float pos_x, float pos_y, Direction d); + Igel(const Vector& pos, Direction d); - void activate(); void write(lisp::Writer& writer); - HitResponse collision_solid(GameObject& object, const CollisionHit& hit); - HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); HitResponse collision_bullet(Bullet& bullet, const CollisionHit& hit); void active_update(float elapsed_time); + virtual Igel* clone() const { return new Igel(*this); } + protected: - bool collision_squished(Player& player); + bool collision_squished(GameObject& object); void be_normal(); /**< switch to state STATE_NORMAL */ void turn_around(); /**< reverse direction, assumes we are in STATE_NORMAL */ bool can_see(const MovingObject& o); /**< check if we can see o */ private: - enum State { - STATE_NORMAL /**< walking around */ - }; - State state; Timer turn_recover_timer; /**< wait time until we will turn around again when shot at */ - bool set_direction; - Direction initial_direction; + }; #endif -