supertux
igel.hpp
1 // SuperTux - Badguy "Igel"
2 // Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_BADGUY_IGEL_HPP
18 #define HEADER_SUPERTUX_BADGUY_IGEL_HPP
19 
20 #include "badguy/walking_badguy.hpp"
21 
23 class Igel final : public WalkingBadguy
24 {
25 public:
26  Igel(const ReaderMapping& reader);
27 
28  virtual HitResponse collision_bullet(Bullet& bullet, const CollisionHit& hit) override;
29 
30  virtual void active_update(float dt_sec) override;
31 
32  virtual bool is_freezable() const override;
33  virtual std::string get_class() const override { return "igel"; }
34  virtual std::string get_display_name() const override { return _("Igel"); }
35 
36 protected:
37  // virtual bool collision_squished(GameObject& object) override;
38  // Enable this and the igel will no longer be butt-jumpable when frozen.
39  // Remember to enable it in .cpp too!
40  void be_normal();
41  void turn_around();
42  bool can_see(const MovingObject& o) const;
44 private:
45  Timer turn_recover_timer;
47 private:
48  Igel(const Igel&) = delete;
49  Igel& operator=(const Igel&) = delete;
50 };
51 
52 #endif
53 
54 /* EOF */
void be_normal()
switch to state STATE_NORMAL
Definition: igel.cpp:39
Definition: bullet.hpp:26
void turn_around()
reverse direction, assumes we are in STATE_NORMAL
Definition: igel.cpp:45
Base class for Badguys that walk on the floor.
Definition: walking_badguy.hpp:25
virtual void active_update(float dt_sec) override
called each frame when the badguy is activated.
Definition: igel.cpp:65
bool can_see(const MovingObject &o) const
check if we can see o
Definition: igel.cpp:52
virtual HitResponse collision_bullet(Bullet &bullet, const CollisionHit &hit) override
Called when the badguy collided with a bullet.
Definition: igel.cpp:87
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:31
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: reader_mapping.hpp:31
Badguy "Igel" - a hedgehog that can absorb bullets.
Definition: igel.hpp:23
This class collects data about a collision.
Definition: collision_hit.hpp:44