replaced bell object with firefly, renamed all hooks back to bell. Changed phone...
authorStephen Groundwater <slacker@gluebox.com>
Sun, 2 Apr 2006 17:45:28 +0000 (17:45 +0000)
committerStephen Groundwater <slacker@gluebox.com>
Sun, 2 Apr 2006 17:45:28 +0000 (17:45 +0000)
SVN-Revision: 3199

42 files changed:
contrib/images/xcf/yeti_animation_template.xcf [new file with mode: 0644]
data/images/objects/bell/bell.sprite [deleted file]
data/images/objects/bell/bell.xcf [deleted file]
data/images/objects/bell/bell1.png [deleted file]
data/images/objects/bell/bell2.png [deleted file]
data/images/objects/bell/bell3.png [deleted file]
data/images/objects/bell/bell4.png [deleted file]
data/images/objects/bell/bell5.png [deleted file]
data/images/objects/bell/bell6.png [deleted file]
data/images/objects/bell/bell7.png [deleted file]
data/images/objects/bonus_block/infoblock.sprite
data/levels/world1/cs.po
data/levels/world1/level1.stl
data/levels/world1/level10.stl
data/levels/world1/level11.stl
data/levels/world1/level12.stl
data/levels/world1/level13.stl
data/levels/world1/level14.stl
data/levels/world1/level15.stl
data/levels/world1/level16.stl
data/levels/world1/level17.stl
data/levels/world1/level18.stl
data/levels/world1/level19.stl
data/levels/world1/level2.stl
data/levels/world1/level20.stl
data/levels/world1/level21.stl
data/levels/world1/level22.stl
data/levels/world1/level23.stl
data/levels/world1/level24.stl
data/levels/world1/level25.stl
data/levels/world1/level26.stl
data/levels/world1/level3.stl
data/levels/world1/level4.stl
data/levels/world1/level5.stl
data/levels/world1/level6.stl
data/levels/world1/level7.stl
data/levels/world1/level8.stl
data/levels/world1/level9.stl
src/object/bell.cpp [deleted file]
src/object/bell.hpp [deleted file]
src/object/firefly.cpp [new file with mode: 0644]
src/object/firefly.hpp [new file with mode: 0644]

diff --git a/contrib/images/xcf/yeti_animation_template.xcf b/contrib/images/xcf/yeti_animation_template.xcf
new file mode 100644 (file)
index 0000000..2d6ab03
Binary files /dev/null and b/contrib/images/xcf/yeti_animation_template.xcf differ
diff --git a/data/images/objects/bell/bell.sprite b/data/images/objects/bell/bell.sprite
deleted file mode 100644 (file)
index e1403d4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-(supertux-sprite
- (action
-  (name "normal")
-  (x-offset 0)
-  (y-offset 0)
-  (images "bell1.png")
- )
- (action
-  (name "ringing")
-(fps 14)
-  (images
-"bell2.png"
-"bell3.png"
-"bell4.png"
-"bell3.png"
-"bell5.png"
-"bell6.png"
-"bell7.png"
-"bell6.png"
-
-  )
- )              
-)
diff --git a/data/images/objects/bell/bell.xcf b/data/images/objects/bell/bell.xcf
deleted file mode 100644 (file)
index e0d4856..0000000
Binary files a/data/images/objects/bell/bell.xcf and /dev/null differ
diff --git a/data/images/objects/bell/bell1.png b/data/images/objects/bell/bell1.png
deleted file mode 100644 (file)
index c437f7b..0000000
Binary files a/data/images/objects/bell/bell1.png and /dev/null differ
diff --git a/data/images/objects/bell/bell2.png b/data/images/objects/bell/bell2.png
deleted file mode 100644 (file)
index 81e6fa6..0000000
Binary files a/data/images/objects/bell/bell2.png and /dev/null differ
diff --git a/data/images/objects/bell/bell3.png b/data/images/objects/bell/bell3.png
deleted file mode 100644 (file)
index aa50033..0000000
Binary files a/data/images/objects/bell/bell3.png and /dev/null differ
diff --git a/data/images/objects/bell/bell4.png b/data/images/objects/bell/bell4.png
deleted file mode 100644 (file)
index f81ca9d..0000000
Binary files a/data/images/objects/bell/bell4.png and /dev/null differ
diff --git a/data/images/objects/bell/bell5.png b/data/images/objects/bell/bell5.png
deleted file mode 100644 (file)
index 85ec1ea..0000000
Binary files a/data/images/objects/bell/bell5.png and /dev/null differ
diff --git a/data/images/objects/bell/bell6.png b/data/images/objects/bell/bell6.png
deleted file mode 100644 (file)
index 0ce2df3..0000000
Binary files a/data/images/objects/bell/bell6.png and /dev/null differ
diff --git a/data/images/objects/bell/bell7.png b/data/images/objects/bell/bell7.png
deleted file mode 100644 (file)
index 9a10728..0000000
Binary files a/data/images/objects/bell/bell7.png and /dev/null differ
index 58ac97e..1c2d086 100644 (file)
@@ -1,6 +1,6 @@
 (supertux-sprite
     (action
       (name "default")
 (supertux-sprite
     (action
       (name "default")
-      (images "info_block.png")
+      (images "infoblock.png")
     )
 )
     )
 )
index 5423817..25434f4 100644 (file)
@@ -214,14 +214,14 @@ msgstr ""
 
 #: data/levels/world1/level1.stl:155
 msgid ""
 
 #: data/levels/world1/level1.stl:155
 msgid ""
-"-Bells:\n"
-"!images/objects/bell/bell-m.png\n"
-"#If you activate the bell\n"
+"-Fireflies:\n"
+"!images/objects/firefly/firefly.png\n"
+"#If you activate the firefly\n"
 "#now, you will restart\n"
 "#under it if you die."
 msgstr ""
 "-Zvonky:\n"
 "#now, you will restart\n"
 "#under it if you die."
 msgstr ""
 "-Zvonky:\n"
-"!images/objects/bell/bell-m.png\n"
+"!images/objects/firefly/firefly.png\n"
 "#Pokud spustíš tento\n"
 "#zvonek, vrátíš se sem\n"
 "#pokud zemřeš."
 "#Pokud spustíš tento\n"
 "#zvonek, vrátíš se sem\n"
 "#pokud zemřeš."
index 3b064bc..fd8a7fc 100644 (file)
       (x 100)
       (y 100)
     )
       (x 100)
       (y 100)
     )
-    (bell (x 5313) (y 289))
+    (firefly (x 5313) (y 289))
     (infoblock
       (x 192) (y 320)
       (message (_ "-Information blocks:
     (infoblock
       (x 192) (y 320)
       (message (_ "-Information blocks:
     )
     (infoblock
       (x 5377) (y 225)
     )
     (infoblock
       (x 5377) (y 225)
-      (message (_ "-Bells:
-!images/objects/bell/bell-m.png
-#If you activate the bell
+      (message (_ "-Fireflies:
+!images/objects/firefly/firefly1.png
+#If you activate the firefly
 #now, you will restart
 #under it if you die."))
     )
 #now, you will restart
 #under it if you die."))
     )
index 252af2c..fd9ab8e 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7889) (y 327))
+    (firefly (x 7889) (y 327))
     (mriceblock (x 613) (y 367))
     (mrbomb  (x 5833) (y 353))
     (mrbomb  (x 6091) (y 334))
     (mriceblock (x 613) (y 367))
     (mrbomb  (x 5833) (y 353))
     (mrbomb  (x 6091) (y 334))
index 4adae08..e312ae9 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 6988) (y 222))
+    (firefly (x 6988) (y 222))
     (jumpy  (x 686) (y 305))
     (jumpy  (x 1431) (y 275))
     (mriceblock  (x 2623) (y 175))
     (jumpy  (x 686) (y 305))
     (jumpy  (x 1431) (y 275))
     (mriceblock  (x 2623) (y 175))
index cfaaefd..f8a92d7 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8433) (y 317))
+    (firefly (x 8433) (y 317))
     (bouncingsnowball  (x 2052) (y 90))
     (bouncingsnowball  (x 1918) (y 205))
     (mriceblock  (x 1848) (y 376))
     (bouncingsnowball  (x 2052) (y 90))
     (bouncingsnowball  (x 1918) (y 205))
     (mriceblock  (x 1848) (y 376))
index e13df84..bcb6d54 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 4384) (y 251))
+    (firefly (x 4384) (y 251))
     (jumpy  (x 1952) (y 64))
     (jumpy  (x 3424) (y 96))
     (jumpy  (x 3680) (y 96))
     (jumpy  (x 1952) (y 64))
     (jumpy  (x 3424) (y 96))
     (jumpy  (x 3680) (y 96))
index 8c60862..9b644fe 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7233) (y 139))
+    (firefly (x 7233) (y 139))
     (mriceblock  (x 4548) (y 317))
     (mriceblock  (x 4633) (y 316))
     (stalactite  (x 5052) (y 42))
     (mriceblock  (x 4548) (y 317))
     (mriceblock  (x 4633) (y 316))
     (stalactite  (x 5052) (y 42))
index f92f0d7..16468af 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8917) (y 310))
+    (firfly (x 8917) (y 310))
     (mrbomb  (x 1135) (y 424))
     (mriceblock  (x 8626) (y 374))
     (mriceblock  (x 8814) (y 405))
     (mrbomb  (x 1135) (y 424))
     (mriceblock  (x 8626) (y 374))
     (mriceblock  (x 8814) (y 405))
index a0a98c2..14aaf01 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8500) (y 283))
+    (firefly (x 8500) (y 283))
     (mriceblock  (x 1799) (y 347))
     (mriceblock  (x 1896) (y 347))
     (mriceblock  (x 1845) (y 347))
     (mriceblock  (x 1799) (y 347))
     (mriceblock  (x 1896) (y 347))
     (mriceblock  (x 1845) (y 347))
index a110528..feda86e 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7823) (y 206))
+    (firfly (x 7823) (y 206))
     (mriceblock  (x 3967) (y 151))
     (mriceblock  (x 3867) (y 247))
     (mrbomb  (x 4313) (y 334))
     (mriceblock  (x 3967) (y 151))
     (mriceblock  (x 3867) (y 247))
     (mrbomb  (x 4313) (y 334))
index eacffdb..275fb93 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8365) (y 311))
+    (firefly (x 8365) (y 311))
     (mriceblock  (x 733) (y 183))
     (mriceblock  (x 1149) (y 183))
     (mriceblock  (x 1406) (y 185))
     (mriceblock  (x 733) (y 183))
     (mriceblock  (x 1149) (y 183))
     (mriceblock  (x 1406) (y 185))
index 3c63e09..6291835 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7083) (y 302))
+    (firefly (x 7083) (y 302))
     (snowball  (x 502) (y 374))
     (mriceblock  (x 1645) (y 375))
     (mrbomb  (x 2152) (y 361))
     (snowball  (x 502) (y 374))
     (mriceblock  (x 1645) (y 375))
     (mrbomb  (x 2152) (y 361))
index d4790d8..b121544 100644 (file)
       (x 100)
       (y 100)
     )
       (x 100)
       (y 100)
     )
-    (bell (x 5568) (y 286))
+    (firefly (x 5568) (y 286))
     (sspiky  (x 873) (y 407))
     (snowball  (x 2338) (y 149))
     (snowball  (x 4655) (y 313))
     (sspiky  (x 873) (y 407))
     (snowball  (x 2338) (y 149))
     (snowball  (x 4655) (y 313))
index 4555f72..903f1ad 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7638) (y 366))
+    (firefly (x 7638) (y 366))
     (mriceblock  (x 591) (y 183))
     (mriceblock  (x 846) (y 180))
     (mriceblock  (x 786) (y 179))
     (mriceblock  (x 591) (y 183))
     (mriceblock  (x 846) (y 180))
     (mriceblock  (x 786) (y 179))
index 1d71929..81d3c4e 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 5922) (y 355))
+    (firefly (x 5922) (y 355))
     (jumpy  (x 4160) (y 188))
     (mrbomb  (x 5128) (y 209))
     (mriceblock  (x 6716) (y 58))
     (jumpy  (x 4160) (y 188))
     (mrbomb  (x 5128) (y 209))
     (mriceblock  (x 6716) (y 58))
index a8a3d76..92ab45b 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 4817) (y 372))
+    (firefly (x 4817) (y 372))
     (mrbomb  (x 580) (y 305))
     (snowball  (x 1238) (y 410))
     (mrbomb  (x 1075) (y 401))
     (mrbomb  (x 580) (y 305))
     (snowball  (x 1238) (y 410))
     (mrbomb  (x 1075) (y 401))
index b079603..c901375 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8329) (y 175))
+    (firfly (x 8329) (y 175))
     (mriceblock  (x 1565) (y 249))
     (mriceblock  (x 1621) (y 251))
     (jumpy  (x 2032) (y 213))
     (mriceblock  (x 1565) (y 249))
     (mriceblock  (x 1621) (y 251))
     (jumpy  (x 2032) (y 213))
index 1dc8fd9..0b94f14 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 6860) (y 222))
+    (firfly (x 6860) (y 222))
     (mriceblock  (x 757) (y 221))
     (mriceblock  (x 689) (y 221))
     (mriceblock  (x 605) (y 221))
     (mriceblock  (x 757) (y 221))
     (mriceblock  (x 689) (y 221))
     (mriceblock  (x 605) (y 221))
index eb5ab79..b1a4e01 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7024) (y 317))
+    (firefly (x 7024) (y 317))
     (snowball  (x 985) (y 220))
     (snowball  (x 939) (y 219))
     (snowball  (x 889) (y 219))
     (snowball  (x 985) (y 220))
     (snowball  (x 939) (y 219))
     (snowball  (x 889) (y 219))
index 154ec20..9958c7a 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 6786) (y 374))
-    (bell (x 14623) (y 186))
+    (firefly (x 6786) (y 374))
+    (firefly (x 14623) (y 186))
     (jumpy  (x 1277) (y 388))
     (mriceblock  (x 4345) (y 380))
     (mriceblock  (x 4115) (y 220))
     (jumpy  (x 1277) (y 388))
     (mriceblock  (x 4345) (y 380))
     (mriceblock  (x 4115) (y 220))
index 3e71d92..7cc6655 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 6445) (y 231))
+    (firefly (x 6445) (y 231))
     (mriceblock  (x 10464) (y 128))
     (mriceblock  (x 3616) (y 160))
     (mrbomb  (x 9398) (y 306))
     (mriceblock  (x 10464) (y 128))
     (mriceblock  (x 3616) (y 160))
     (mrbomb  (x 9398) (y 306))
index ef5e9ac..6258099 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 4718) (y 336))
+    (firefly (x 4718) (y 336))
     (jumpy  (x 6752) (y 32))
     (jumpy  (x 6528) (y 192))
     (jumpy  (x 288) (y 224))
     (jumpy  (x 6752) (y 32))
     (jumpy  (x 6528) (y 192))
     (jumpy  (x 288) (y 224))
index f5db259..174970a 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 5006) (y 269))
+    (firefly (x 5006) (y 269))
     (snowball  (x 4800) (y 160))
     (snowball  (x 8153) (y 153))
     (jumpy  (x 9056) (y 159))
     (snowball  (x 4800) (y 160))
     (snowball  (x 8153) (y 153))
     (jumpy  (x 9056) (y 159))
index a728abb..c0fac75 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8480) (y 352))
+    (firefly (x 8480) (y 352))
     (mriceblock  (x 1678) (y 293))
     (mriceblock  (x 1976) (y 335))
     (mriceblock  (x 2775) (y 221))
     (mriceblock  (x 1678) (y 293))
     (mriceblock  (x 1976) (y 335))
     (mriceblock  (x 2775) (y 221))
index 3e25075..4a85e91 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7648) (y 331))
+    (fiefly (x 7648) (y 331))
     (stalactite  (x 1469) (y 192))
     (stalactite  (x 1631) (y 192))
     (stalactite  (x 2622) (y 261))
     (stalactite  (x 1469) (y 192))
     (stalactite  (x 1631) (y 192))
     (stalactite  (x 2622) (y 261))
index a40da5e..2872957 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 8123) (y 310))
+    (firefly (x 8123) (y 310))
     (mriceblock  (x 4443) (y 109))
     (mriceblock  (x 4325) (y 232))
     (jumpy  (x 3952) (y 216))
     (mriceblock  (x 4443) (y 109))
     (mriceblock  (x 4325) (y 232))
     (jumpy  (x 3952) (y 216))
index 83b8bfc..39a9db0 100644 (file)
       (x 100)
       (y 170)
     )
       (x 100)
       (y 170)
     )
-    (bell (x 7613) (y 254))
+    (firefly (x 7613) (y 254))
     (jumpy  (x 13009) (y 259))
     (jumpy  (x 13618) (y 167))
     (jumpy  (x 15150) (y 324))
     (jumpy  (x 13009) (y 259))
     (jumpy  (x 13618) (y 167))
     (jumpy  (x 15150) (y 324))
diff --git a/src/object/bell.cpp b/src/object/bell.cpp
deleted file mode 100644 (file)
index 97ba802..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//  $Id$
-// 
-//  SuperTux
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
-//
-//  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 2
-//  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, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-//  02111-1307, USA.
-#include <config.h>
-
-#include "bell.hpp"
-#include "resources.hpp"
-#include "sprite/sprite_manager.hpp"
-#include "video/drawing_context.hpp"
-#include "player.hpp"
-#include "object_factory.hpp"
-#include "game_session.hpp"
-#include "sector.hpp"
-
-Bell::Bell(const lisp::Lisp& lisp)
-  : ringing(false)
-{
-  lisp.get("x", bbox.p1.x);
-  lisp.get("y", bbox.p1.y);
-  bbox.set_size(32, 32);
-  sprite = sprite_manager->create("images/objects/bell/bell.sprite");
-  set_group(COLGROUP_TOUCHABLE);
-}
-
-Bell::~Bell()
-{
-  delete sprite;
-}
-
-void
-Bell::write(lisp::Writer& writer)
-{
-  writer.start_list("bell");
-  writer.write_float("x", bbox.p1.x);
-  writer.write_float("y", bbox.p1.y);
-  writer.end_list("bell");
-}
-
-void
-Bell::update(float )
-{
-}
-
-void
-Bell::draw(DrawingContext& context)
-{
-  sprite->draw(context, get_pos(), LAYER_TILES);
-}
-
-HitResponse
-Bell::collision(GameObject& other, const CollisionHit& )
-{
-  if(ringing)
-    return ABORT_MOVE;
-  
-  Player* player = dynamic_cast<Player*> (&other);
-  if(player) {
-    ringing = true;
-    // TODO play sound
-    sprite->set_action("ringing");
-    GameSession::current()->set_reset_point(Sector::current()->get_name(),
-        get_pos());
-  }
-  
-  return ABORT_MOVE;
-}
-
-IMPLEMENT_FACTORY(Bell, "bell");
diff --git a/src/object/bell.hpp b/src/object/bell.hpp
deleted file mode 100644 (file)
index 5919723..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//  $Id$
-// 
-//  SuperTux
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
-//
-//  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 2
-//  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, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-//  02111-1307, USA.
-#ifndef __BELL_H__
-#define __BELL_H__
-
-#include "lisp/lisp.hpp"
-#include "moving_object.hpp"
-#include "sprite/sprite.hpp"
-#include "serializable.hpp"
-
-/**
- * A bell: When tux touches it, it begins ringing and you will respawn at this
- * position.
- */
-class Bell : public MovingObject, public Serializable
-{
-public:
-  Bell(const lisp::Lisp& lisp);
-  ~Bell();
-
-  void write(lisp::Writer& writer);
-  void update(float elapsed_time);
-  void draw(DrawingContext& context);
-  HitResponse collision(GameObject& other, const CollisionHit& hit);
-
-private:
-  Sprite* sprite;
-  bool ringing;
-};
-
-#endif
-
diff --git a/src/object/firefly.cpp b/src/object/firefly.cpp
new file mode 100644 (file)
index 0000000..a9278c3
--- /dev/null
@@ -0,0 +1,84 @@
+//  $Id: Firefly.cpp 2979 2006-01-10 00:00:04Z matzebraun $
+// 
+//  SuperTux
+//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//
+//  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 2
+//  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, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+#include <config.h>
+
+#include "firefly.hpp"
+#include "resources.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "video/drawing_context.hpp"
+#include "player.hpp"
+#include "object_factory.hpp"
+#include "game_session.hpp"
+#include "sector.hpp"
+
+Firefly::Firefly(const lisp::Lisp& lisp)
+  : ringing(false)
+{
+  lisp.get("x", bbox.p1.x);
+  lisp.get("y", bbox.p1.y);
+  bbox.set_size(32, 32);
+  sprite = sprite_manager->create("images/objects/firefly/firefly.sprite");
+  set_group(COLGROUP_TOUCHABLE);
+}
+
+Firefly::~Firefly()
+{
+  delete sprite;
+}
+
+void
+Firefly::write(lisp::Writer& writer)
+{
+  writer.start_list("firefly");
+  writer.write_float("x", bbox.p1.x);
+  writer.write_float("y", bbox.p1.y);
+  writer.end_list("Firefly");
+}
+
+void
+Firefly::update(float )
+{
+}
+
+void
+Firefly::draw(DrawingContext& context)
+{
+  sprite->draw(context, get_pos(), LAYER_TILES);
+}
+
+HitResponse
+Firefly::collision(GameObject& other, const CollisionHit& )
+{
+  if(ringing)
+    return ABORT_MOVE;
+  
+  Player* player = dynamic_cast<Player*> (&other);
+  if(player) {
+    ringing = true;
+    // TODO play sound
+    sprite->set_action("ringing");
+    GameSession::current()->set_reset_point(Sector::current()->get_name(),
+        get_pos());
+  }
+  
+  return ABORT_MOVE;
+}
+
+IMPLEMENT_FACTORY(Firefly, "firefly");
diff --git a/src/object/firefly.hpp b/src/object/firefly.hpp
new file mode 100644 (file)
index 0000000..6f9f021
--- /dev/null
@@ -0,0 +1,49 @@
+//  $Id: bell.hpp 2642 2005-06-26 13:38:53Z matzebraun $
+// 
+//  SuperTux
+//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//
+//  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 2
+//  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, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+//  02111-1307, USA.
+#ifndef __FIREFLY_H__
+#define __FIREFLY_H__
+
+#include "lisp/lisp.hpp"
+#include "moving_object.hpp"
+#include "sprite/sprite.hpp"
+#include "serializable.hpp"
+
+/**
+ * A Firefly: When tux touches it, it begins buzzing and you will respawn at this
+ * position.
+ */
+class Firefly : public MovingObject, public Serializable
+{
+public:
+  Firefly(const lisp::Lisp& lisp);
+  ~Firefly();
+
+  void write(lisp::Writer& writer);
+  void update(float elapsed_time);
+  void draw(DrawingContext& context);
+  HitResponse collision(GameObject& other, const CollisionHit& hit);
+
+private:
+  Sprite* sprite;
+  bool ringing;
+};
+
+#endif
+