Renamed walkingflame to livefire including sleeping and dormant versions
authorLMH <lmh.0013@gmail.com>
Sat, 6 Jul 2013 01:55:20 +0000 (15:55 -1000)
committerLMH <lmh.0013@gmail.com>
Sat, 6 Jul 2013 01:55:20 +0000 (15:55 -1000)
23 files changed:
data/images/creatures/livefire/left-0.png [new file with mode: 0644]
data/images/creatures/livefire/left-1.png [new file with mode: 0644]
data/images/creatures/livefire/left-2.png [new file with mode: 0644]
data/images/creatures/livefire/livefire.sprite [new file with mode: 0644]
data/images/creatures/livefire/sleeping-left.png [new file with mode: 0644]
data/images/creatures/livefire/waking-left-0.png [new file with mode: 0644]
data/images/creatures/livefire/waking-left-1.png [new file with mode: 0644]
data/images/creatures/livefire/waking-left-2.png [new file with mode: 0644]
data/images/creatures/walkingflame/iced-left.png [deleted file]
data/images/creatures/walkingflame/left-0.png [deleted file]
data/images/creatures/walkingflame/left-1.png [deleted file]
data/images/creatures/walkingflame/left-2.png [deleted file]
data/images/creatures/walkingflame/sleeping-left.png [deleted file]
data/images/creatures/walkingflame/waking-left-0.png [deleted file]
data/images/creatures/walkingflame/waking-left-1.png [deleted file]
data/images/creatures/walkingflame/waking-left-2.png [deleted file]
data/images/creatures/walkingflame/walkingflame.sprite [deleted file]
data/levels/test/glow_effects.stl
src/badguy/livefire.cpp [new file with mode: 0644]
src/badguy/livefire.hpp [new file with mode: 0644]
src/badguy/walkingflame.cpp [deleted file]
src/badguy/walkingflame.hpp [deleted file]
src/supertux/object_factory.cpp

diff --git a/data/images/creatures/livefire/left-0.png b/data/images/creatures/livefire/left-0.png
new file mode 100644 (file)
index 0000000..6a0cd01
Binary files /dev/null and b/data/images/creatures/livefire/left-0.png differ
diff --git a/data/images/creatures/livefire/left-1.png b/data/images/creatures/livefire/left-1.png
new file mode 100644 (file)
index 0000000..d773b0a
Binary files /dev/null and b/data/images/creatures/livefire/left-1.png differ
diff --git a/data/images/creatures/livefire/left-2.png b/data/images/creatures/livefire/left-2.png
new file mode 100644 (file)
index 0000000..6b9721f
Binary files /dev/null and b/data/images/creatures/livefire/left-2.png differ
diff --git a/data/images/creatures/livefire/livefire.sprite b/data/images/creatures/livefire/livefire.sprite
new file mode 100644 (file)
index 0000000..0bad70a
--- /dev/null
@@ -0,0 +1,32 @@
+(supertux-sprite
+ (action
+  (name "left")
+  (hitbox 6 10 31.8 31.8)
+  (images "left-0.png"
+   "left-1.png"
+   "left-2.png"))
+ (action
+  (name "right")
+  (hitbox 6 10 31.8 31.8)
+  (mirror-action "left"))
+ (action
+  (name "sleeping-left")
+  (hitbox 6 10 31.8 31.8)
+  (images "sleeping-left.png"))
+ (action
+  (name "sleeping-right")
+  (hitbox 6 10 31.8 31.8)
+  (mirror-action "sleeping-left"))
+ (action
+  (name "waking-left")
+  (hitbox 6 10 31.8 31.8)
+  (fps 6.0)
+  (images "waking-left-0.png"
+   "waking-left-1.png"
+   "waking-left-2.png"))
+ (action
+  (name "waking-right")
+  (fps 6.0)
+  (hitbox 6 10 31.8 31.8)
+  (mirror-action "waking-left"))
+)
diff --git a/data/images/creatures/livefire/sleeping-left.png b/data/images/creatures/livefire/sleeping-left.png
new file mode 100644 (file)
index 0000000..fcbacb2
Binary files /dev/null and b/data/images/creatures/livefire/sleeping-left.png differ
diff --git a/data/images/creatures/livefire/waking-left-0.png b/data/images/creatures/livefire/waking-left-0.png
new file mode 100644 (file)
index 0000000..272cd3f
Binary files /dev/null and b/data/images/creatures/livefire/waking-left-0.png differ
diff --git a/data/images/creatures/livefire/waking-left-1.png b/data/images/creatures/livefire/waking-left-1.png
new file mode 100644 (file)
index 0000000..637654f
Binary files /dev/null and b/data/images/creatures/livefire/waking-left-1.png differ
diff --git a/data/images/creatures/livefire/waking-left-2.png b/data/images/creatures/livefire/waking-left-2.png
new file mode 100644 (file)
index 0000000..d773b0a
Binary files /dev/null and b/data/images/creatures/livefire/waking-left-2.png differ
diff --git a/data/images/creatures/walkingflame/iced-left.png b/data/images/creatures/walkingflame/iced-left.png
deleted file mode 100644 (file)
index 09a3f11..0000000
Binary files a/data/images/creatures/walkingflame/iced-left.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/left-0.png b/data/images/creatures/walkingflame/left-0.png
deleted file mode 100644 (file)
index 6a0cd01..0000000
Binary files a/data/images/creatures/walkingflame/left-0.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/left-1.png b/data/images/creatures/walkingflame/left-1.png
deleted file mode 100644 (file)
index d773b0a..0000000
Binary files a/data/images/creatures/walkingflame/left-1.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/left-2.png b/data/images/creatures/walkingflame/left-2.png
deleted file mode 100644 (file)
index 6b9721f..0000000
Binary files a/data/images/creatures/walkingflame/left-2.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/sleeping-left.png b/data/images/creatures/walkingflame/sleeping-left.png
deleted file mode 100644 (file)
index fcbacb2..0000000
Binary files a/data/images/creatures/walkingflame/sleeping-left.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/waking-left-0.png b/data/images/creatures/walkingflame/waking-left-0.png
deleted file mode 100644 (file)
index 272cd3f..0000000
Binary files a/data/images/creatures/walkingflame/waking-left-0.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/waking-left-1.png b/data/images/creatures/walkingflame/waking-left-1.png
deleted file mode 100644 (file)
index 637654f..0000000
Binary files a/data/images/creatures/walkingflame/waking-left-1.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/waking-left-2.png b/data/images/creatures/walkingflame/waking-left-2.png
deleted file mode 100644 (file)
index d773b0a..0000000
Binary files a/data/images/creatures/walkingflame/waking-left-2.png and /dev/null differ
diff --git a/data/images/creatures/walkingflame/walkingflame.sprite b/data/images/creatures/walkingflame/walkingflame.sprite
deleted file mode 100644 (file)
index 27d1df3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-(supertux-sprite
- (action
-  (name "left")
-  (hitbox 6 10 31.8 31.8)
-  (images "left-0.png"
-   "left-1.png"
-   "left-2.png"))
- (action
-  (name "right")
-  (hitbox 6 10 31.8 31.8)
-  (mirror-action "left"))
- (action
-  (name "iced-left")
-  (hitbox 6 10 31.8 31.8)
-  (images "iced-left.png"))
- (action
-  (name "iced-right")
-  (hitbox 6 10 31.8 31.8)
-  (mirror-action "iced-left")
- )
- (action
-  (name "sleeping-left")
-  (hitbox 6 10 31.8 31.8)
-  (images "sleeping-left.png"))
- (action
-  (name "sleeping-right")
-  (hitbox 6 10 31.8 31.8)
-  (mirror-action "sleeping-left"))
- (action
-  (name "waking-left")
-  (hitbox 6 10 31.8 31.8)
-  (fps 6.0)
-  (images "waking-left-0.png"
-   "waking-left-1.png"
-   "waking-left-2.png"))
- (action
-  (name "waking-right")
-  (fps 6.0)
-  (hitbox 6 10 31.8 31.8)
-  (mirror-action "waking-left"))
-)
index 2fe85e3..be3cb58 100755 (executable)
@@ -22,9 +22,9 @@
                (flame  (x      576     )(y     480     )(speed 0.2))
                (iceflame       (x      736     )(y     480     )(speed 0.2))
                (ghostflame     (x      656     )(y     96      ))
-    (walkingflame (x 224 )(y 192 ))
-    (swalkingflame (x 64 )(y 192 )(direction "right"))
-    (dwalkingflame (x 128)(y 192))
+    (livefire (x 224 )(y 192 ))
+    (livefire_asleep (x 64 )(y 192 )(direction "right"))
+    (livefire_dormant (x 128)(y 192))
 
                (tilemap        (name   "Interactive"   )                                                                                                                                                                                                                                                                                                               
                        (z-pos  0       )(solid #t      )                                                                                                                                                                                                                                                                                               
diff --git a/src/badguy/livefire.cpp b/src/badguy/livefire.cpp
new file mode 100644 (file)
index 0000000..955fad0
--- /dev/null
@@ -0,0 +1,182 @@
+//  SuperTux badguy - walking flame that glows
+//  Copyright (C) 2013 LMH <lmh.0013@gmail.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  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, see <http://www.gnu.org/licenses/>.
+
+#include "badguy/livefire.hpp"
+
+#include "audio/sound_manager.hpp"
+#include "object/player.hpp"
+#include "object/sprite_particle.hpp"
+#include "sprite/sprite.hpp"
+#include "supertux/object_factory.hpp"
+#include "supertux/sector.hpp"
+
+static const float WALKSPEED = 80;
+static const float MAXDROPHEIGHT = 20;
+
+LiveFire::LiveFire(const Reader& reader) :
+  WalkingBadguy(reader, "images/creatures/livefire/livefire.sprite", "left", "right"),
+  lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-medium.sprite")),
+  state(STATE_WALKING)  
+{
+  walk_speed = WALKSPEED;
+  max_drop_height = MAXDROPHEIGHT;
+  lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
+  lightsprite->set_color(Color(1.0f, 0.9f, 0.8f));
+}
+
+void
+LiveFire::collision_solid(const CollisionHit& hit)
+{
+  if(state != STATE_WALKING) {
+    BadGuy::collision_solid(hit);
+    return;
+  }
+  WalkingBadguy::collision_solid(hit);
+}
+
+HitResponse
+LiveFire::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
+{
+  if(state != STATE_WALKING) {
+    return BadGuy::collision_badguy(badguy, hit);
+  }
+  return WalkingBadguy::collision_badguy(badguy, hit);
+}
+
+void
+LiveFire::active_update(float elapsed_time) {
+
+  if(state == STATE_WALKING) {
+    WalkingBadguy::active_update(elapsed_time);
+    return;
+  }
+
+  if(state == STATE_SLEEPING) {
+
+    Player* player = this->get_nearest_player();
+    if (player) {
+      Rectf mb = this->get_bbox();
+      Rectf pb = player->get_bbox();
+
+      bool inReach_left = (pb.p2.x >= mb.p2.x-((dir == LEFT) ? 256 : 0));
+      bool inReach_right = (pb.p1.x <= mb.p1.x+((dir == RIGHT) ? 256 : 0));
+      bool inReach_top = (pb.p2.y >= mb.p1.y);
+      bool inReach_bottom = (pb.p1.y <= mb.p2.y);
+
+      if (inReach_left && inReach_right && inReach_top && inReach_bottom) {
+        // wake up
+        sprite->set_action(dir == LEFT ? "waking-left" : "waking-right", 1);
+        state = STATE_WAKING;
+      }
+    }
+
+    BadGuy::active_update(elapsed_time);
+  }
+
+  if(state == STATE_WAKING) {
+    if(sprite->animation_done()) {
+      // start walking
+      state = STATE_WALKING;
+      WalkingBadguy::initialize();
+    }
+
+    BadGuy::active_update(elapsed_time);
+  }
+}
+
+void
+LiveFire::draw(DrawingContext& context)
+{
+  //Draw the Sprite.
+  sprite->draw(context, get_pos(), LAYER_OBJECTS);
+  //Draw the light
+  context.push_target();
+  context.set_target(DrawingContext::LIGHTMAP);
+  lightsprite->draw(context, get_bbox().get_middle(), 0);
+  context.pop_target();
+}
+
+void
+LiveFire::freeze()
+{
+  // attempting to freeze a flame causes it to go out
+  kill_fall();
+}
+
+bool
+LiveFire::is_freezable() const
+{
+  return true;
+}
+
+bool
+LiveFire::is_flammable() const
+{
+  return false;
+}
+
+void
+LiveFire::kill_fall()
+{
+  //TODO: get unique sound for ice-fire encounters
+  sound_manager->play("sounds/fall.wav", get_pos());
+  // throw a puff of smoke
+  Vector ppos = bbox.get_middle();
+  Vector pspeed = Vector(0, -150);
+  Vector paccel = Vector(0,0);
+  Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_BACKGROUNDTILES+2));
+  // extinguish the flame
+  sprite->set_action(dir == LEFT ? "extinguish-left" : "extinguish-right");
+  physic.set_velocity_y(0);
+  physic.set_acceleration_y(0);
+  physic.enable_gravity(false);
+  set_state(STATE_SQUISHED); // used to nullify any threat and remove
+
+  // start dead-script
+  run_dead_script();
+}
+
+/* The following defines a sleeping version */
+
+LiveFireAsleep::LiveFireAsleep(const Reader& reader) :
+  LiveFire(reader)
+{
+  state = STATE_SLEEPING;
+}
+
+void
+LiveFireAsleep::initialize()
+{
+  physic.set_velocity_x(0);
+  sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right");
+}
+
+/* The following defines a dormant version that never wakes */
+LiveFireDormant::LiveFireDormant(const Reader& reader) :
+  LiveFire(reader)
+{
+  walk_speed = 0;
+  state = STATE_DORMANT;
+}
+
+void
+LiveFireDormant::initialize()
+{
+  physic.set_velocity_x(0);
+  sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right");
+}
+
+/* EOF */
diff --git a/src/badguy/livefire.hpp b/src/badguy/livefire.hpp
new file mode 100644 (file)
index 0000000..ff0db66
--- /dev/null
@@ -0,0 +1,69 @@
+//  SuperTux badguy - walking flame that glows
+//  Copyright (C) 2013 LMH <lmh.0013@gmail.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  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, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_SUPERTUX_BADGUY_LiveFire_HPP
+#define HEADER_SUPERTUX_BADGUY_LiveFire_HPP
+
+#include "badguy/walking_badguy.hpp"
+
+class LiveFire : public WalkingBadguy
+{
+public:
+  LiveFire(const Reader& reader);
+
+  void collision_solid(const CollisionHit& hit);
+  HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit);
+  void active_update(float elapsed_time);
+  void draw(DrawingContext& context);
+
+  void freeze();
+  bool is_freezable() const;
+  bool is_flammable() const;
+
+  virtual void kill_fall();
+
+private:
+  SpritePtr lightsprite;
+
+protected:
+  enum SState {
+    STATE_SLEEPING,
+    STATE_WAKING,
+    STATE_WALKING,
+    STATE_DORMANT
+  };
+  SState state;
+};
+
+class LiveFireAsleep : public LiveFire
+{
+public:
+  LiveFireAsleep(const Reader& reader);
+
+  void initialize();
+};
+
+class LiveFireDormant : public LiveFire
+{
+public:
+  LiveFireDormant(const Reader& reader);
+  
+  void initialize();
+};
+
+#endif
+
+/* EOF */
diff --git a/src/badguy/walkingflame.cpp b/src/badguy/walkingflame.cpp
deleted file mode 100644 (file)
index dcf9ee8..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-//  SuperTux badguy - walking flame that glows
-//  Copyright (C) 2013 LMH <lmh.0013@gmail.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  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, see <http://www.gnu.org/licenses/>.
-
-#include "badguy/walkingflame.hpp"
-
-#include "audio/sound_manager.hpp"
-#include "object/player.hpp"
-#include "object/sprite_particle.hpp"
-#include "sprite/sprite.hpp"
-#include "supertux/object_factory.hpp"
-#include "supertux/sector.hpp"
-
-static const float WALKSPEED = 80;
-static const float MAXDROPHEIGHT = 20;
-
-WalkingFlame::WalkingFlame(const Reader& reader) :
-  WalkingBadguy(reader, "images/creatures/walkingflame/walkingflame.sprite", "left", "right"),
-  lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-medium.sprite")),
-  state(STATE_WALKING)  
-{
-  walk_speed = WALKSPEED;
-  max_drop_height = MAXDROPHEIGHT;
-  lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
-  lightsprite->set_color(Color(1.0f, 0.9f, 0.8f));
-}
-
-void
-WalkingFlame::collision_solid(const CollisionHit& hit)
-{
-  if(state != STATE_WALKING) {
-    BadGuy::collision_solid(hit);
-    return;
-  }
-  WalkingBadguy::collision_solid(hit);
-}
-
-HitResponse
-WalkingFlame::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
-{
-  if(state != STATE_WALKING) {
-    return BadGuy::collision_badguy(badguy, hit);
-  }
-  return WalkingBadguy::collision_badguy(badguy, hit);
-}
-
-void
-WalkingFlame::active_update(float elapsed_time) {
-
-  if(state == STATE_WALKING) {
-    WalkingBadguy::active_update(elapsed_time);
-    return;
-  }
-
-  if(state == STATE_SLEEPING) {
-
-    Player* player = this->get_nearest_player();
-    if (player) {
-      Rectf mb = this->get_bbox();
-      Rectf pb = player->get_bbox();
-
-      bool inReach_left = (pb.p2.x >= mb.p2.x-((dir == LEFT) ? 256 : 0));
-      bool inReach_right = (pb.p1.x <= mb.p1.x+((dir == RIGHT) ? 256 : 0));
-      bool inReach_top = (pb.p2.y >= mb.p1.y);
-      bool inReach_bottom = (pb.p1.y <= mb.p2.y);
-
-      if (inReach_left && inReach_right && inReach_top && inReach_bottom) {
-        // wake up
-        sprite->set_action(dir == LEFT ? "waking-left" : "waking-right", 1);
-        state = STATE_WAKING;
-      }
-    }
-
-    BadGuy::active_update(elapsed_time);
-  }
-
-  if(state == STATE_WAKING) {
-    if(sprite->animation_done()) {
-      // start walking
-      state = STATE_WALKING;
-      WalkingBadguy::initialize();
-    }
-
-    BadGuy::active_update(elapsed_time);
-  }
-}
-
-void
-WalkingFlame::draw(DrawingContext& context)
-{
-  //Draw the Sprite.
-  sprite->draw(context, get_pos(), LAYER_OBJECTS);
-  //Draw the light
-  context.push_target();
-  context.set_target(DrawingContext::LIGHTMAP);
-  lightsprite->draw(context, get_bbox().get_middle(), 0);
-  context.pop_target();
-}
-
-void
-WalkingFlame::freeze()
-{
-  // attempting to freeze a flame causes it to go out
-  kill_fall();
-}
-
-bool
-WalkingFlame::is_freezable() const
-{
-  return true;
-}
-
-bool
-WalkingFlame::is_flammable() const
-{
-  return false;
-}
-
-void
-WalkingFlame::kill_fall()
-{
-  //TODO: get unique sound for ice-fire encounters
-  sound_manager->play("sounds/fall.wav", get_pos());
-  // throw a puff of smoke
-  Vector ppos = bbox.get_middle();
-  Vector pspeed = Vector(0, -150);
-  Vector paccel = Vector(0,0);
-  Sector::current()->add_object(new SpriteParticle("images/objects/particles/smoke.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_BACKGROUNDTILES+2));
-  // extinguish the flame
-  sprite->set_action(dir == LEFT ? "extinguish-left" : "extinguish-right");
-  physic.set_velocity_y(0);
-  physic.set_acceleration_y(0);
-  physic.enable_gravity(false);
-  set_state(STATE_SQUISHED); // used to nullify any threat and remove
-
-  // start dead-script
-  run_dead_script();
-}
-
-/* The following defines a sleeping version */
-
-SWalkingFlame::SWalkingFlame(const Reader& reader) :
-  WalkingFlame(reader)
-{
-  state = STATE_SLEEPING;
-}
-
-void
-SWalkingFlame::initialize()
-{
-  physic.set_velocity_x(0);
-  sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right");
-}
-
-/* The following defines a dormant version that never wakes */
-DWalkingFlame::DWalkingFlame(const Reader& reader) :
-  WalkingFlame(reader)
-{
-  walk_speed = 0;
-  state = STATE_DORMANT;
-}
-
-void
-DWalkingFlame::initialize()
-{
-  physic.set_velocity_x(0);
-  sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right");
-}
-
-/* EOF */
diff --git a/src/badguy/walkingflame.hpp b/src/badguy/walkingflame.hpp
deleted file mode 100644 (file)
index 69e2e54..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//  SuperTux badguy - walking flame that glows
-//  Copyright (C) 2013 LMH <lmh.0013@gmail.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  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, see <http://www.gnu.org/licenses/>.
-
-#ifndef HEADER_SUPERTUX_BADGUY_WALKINGFLAME_HPP
-#define HEADER_SUPERTUX_BADGUY_WALKINGFLAME_HPP
-
-#include "badguy/walking_badguy.hpp"
-
-class WalkingFlame : public WalkingBadguy
-{
-public:
-  WalkingFlame(const Reader& reader);
-
-  void collision_solid(const CollisionHit& hit);
-  HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit);
-  void active_update(float elapsed_time);
-  void draw(DrawingContext& context);
-
-  void freeze();
-  bool is_freezable() const;
-  bool is_flammable() const;
-
-  virtual void kill_fall();
-
-private:
-  SpritePtr lightsprite;
-
-protected:
-  enum SState {
-    STATE_SLEEPING,
-    STATE_WAKING,
-    STATE_WALKING,
-    STATE_DORMANT
-  };
-  SState state;
-};
-
-class SWalkingFlame : public WalkingFlame
-{
-public:
-  SWalkingFlame(const Reader& reader);
-
-  void initialize();
-};
-
-class DWalkingFlame : public WalkingFlame
-{
-public:
-  DWalkingFlame(const Reader& reader);
-  
-  void initialize();
-};
-
-#endif
-
-/* EOF */
index ce556ae..052b700 100644 (file)
@@ -44,6 +44,7 @@
 #include "badguy/jumpy.hpp"
 #include "badguy/kamikazesnowball.hpp"
 #include "badguy/kugelblitz.hpp"
+#include "badguy/livefire.hpp"
 #include "badguy/mole.hpp"
 #include "badguy/mole_rock.hpp"
 #include "badguy/mrbomb.hpp"
@@ -68,7 +69,6 @@
 #include "badguy/totem.hpp"
 #include "badguy/treewillowisp.hpp"
 #include "badguy/walking_badguy.hpp"
-#include "badguy/walkingflame.hpp"
 #include "badguy/walkingleaf.hpp"
 #include "badguy/willowisp.hpp"
 #include "badguy/yeti.hpp"
@@ -186,7 +186,6 @@ ObjectFactory::init_factories()
   add_factory<Dart>("dart");
   add_factory<DartTrap>("darttrap");
   add_factory<Dispenser>("dispenser");
-  add_factory<DWalkingFlame>("dwalkingflame");//
   add_factory<Fish>("fish");
   add_factory<Flame>("flame");
   add_factory<FlyingSnowBall>("flyingsnowball");
@@ -198,6 +197,9 @@ ObjectFactory::init_factories()
   add_factory<Jumpy>("jumpy");
   add_factory<KamikazeSnowball>("kamikazesnowball");
   add_factory<Kugelblitz>("kugelblitz");
+  add_factory<LiveFire>("livefire");
+  add_factory<LiveFireAsleep>("livefire_asleep");
+  add_factory<LiveFireDormant>("livefire_dormant");
   add_factory<Mole>("mole");
   add_factory<MoleRock>("mole_rock");
   add_factory<MrBomb>("mrbomb");
@@ -218,10 +220,8 @@ ObjectFactory::init_factories()
   add_factory<Spiky>("spiky");
   add_factory<Stalactite>("stalactite");
   add_factory<Stumpy>("stumpy");
-  add_factory<SWalkingFlame>("swalkingflame");//
   add_factory<Toad>("toad");
   add_factory<Totem>("totem");
-  add_factory<WalkingFlame>("walkingflame");
   add_factory<WalkingLeaf>("walkingleaf");
   add_factory<WillOWisp>("willowisp");
   add_factory<Yeti>("yeti");