From: Stephen Groundwater Date: Sun, 2 Apr 2006 17:45:28 +0000 (+0000) Subject: replaced bell object with firefly, renamed all hooks back to bell. Changed phone... X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d4183ad3274efb5bc91c021e048d981af9ec567a;p=supertux.git replaced bell object with firefly, renamed all hooks back to bell. Changed phone info block to display '?' graphic. SVN-Revision: 3199 --- diff --git a/contrib/images/xcf/yeti_animation_template.xcf b/contrib/images/xcf/yeti_animation_template.xcf new file mode 100644 index 000000000..2d6ab0308 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 index e1403d4bc..000000000 --- a/data/images/objects/bell/bell.sprite +++ /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 index e0d48562e..000000000 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 index c437f7b25..000000000 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 index 81e6fa697..000000000 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 index aa500339f..000000000 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 index f81ca9d14..000000000 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 index 85ec1ea9f..000000000 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 index 0ce2df3c8..000000000 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 index 9a107282b..000000000 Binary files a/data/images/objects/bell/bell7.png and /dev/null differ diff --git a/data/images/objects/bonus_block/infoblock.sprite b/data/images/objects/bonus_block/infoblock.sprite index 58ac97e90..1c2d08684 100644 --- a/data/images/objects/bonus_block/infoblock.sprite +++ b/data/images/objects/bonus_block/infoblock.sprite @@ -1,6 +1,6 @@ (supertux-sprite (action (name "default") - (images "info_block.png") + (images "infoblock.png") ) ) diff --git a/data/levels/world1/cs.po b/data/levels/world1/cs.po index 5423817b3..25434f4ae 100644 --- a/data/levels/world1/cs.po +++ b/data/levels/world1/cs.po @@ -214,14 +214,14 @@ msgstr "" #: 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" -"!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š." diff --git a/data/levels/world1/level1.stl b/data/levels/world1/level1.stl index 3b064bcea..fd8a7fc10 100644 --- a/data/levels/world1/level1.stl +++ b/data/levels/world1/level1.stl @@ -107,7 +107,7 @@ (x 100) (y 100) ) - (bell (x 5313) (y 289)) + (firefly (x 5313) (y 289)) (infoblock (x 192) (y 320) (message (_ "-Information blocks: @@ -152,9 +152,9 @@ ) (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.")) ) diff --git a/data/levels/world1/level10.stl b/data/levels/world1/level10.stl index 252af2c81..fd9ab8ea6 100644 --- a/data/levels/world1/level10.stl +++ b/data/levels/world1/level10.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level11.stl b/data/levels/world1/level11.stl index 4adae085c..e312ae99e 100644 --- a/data/levels/world1/level11.stl +++ b/data/levels/world1/level11.stl @@ -110,7 +110,7 @@ (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)) diff --git a/data/levels/world1/level12.stl b/data/levels/world1/level12.stl index cfaaefdf9..f8a92d70c 100644 --- a/data/levels/world1/level12.stl +++ b/data/levels/world1/level12.stl @@ -110,7 +110,7 @@ (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)) diff --git a/data/levels/world1/level13.stl b/data/levels/world1/level13.stl index e13df84a4..bcb6d5478 100644 --- a/data/levels/world1/level13.stl +++ b/data/levels/world1/level13.stl @@ -111,7 +111,7 @@ (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)) diff --git a/data/levels/world1/level14.stl b/data/levels/world1/level14.stl index 8c60862d4..9b644fe4c 100644 --- a/data/levels/world1/level14.stl +++ b/data/levels/world1/level14.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level15.stl b/data/levels/world1/level15.stl index f92f0d7bc..16468afcc 100644 --- a/data/levels/world1/level15.stl +++ b/data/levels/world1/level15.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level16.stl b/data/levels/world1/level16.stl index a0a98c2d0..14aaf01b3 100644 --- a/data/levels/world1/level16.stl +++ b/data/levels/world1/level16.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level17.stl b/data/levels/world1/level17.stl index a1105281e..feda86eeb 100644 --- a/data/levels/world1/level17.stl +++ b/data/levels/world1/level17.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level18.stl b/data/levels/world1/level18.stl index eacffdbce..275fb93c1 100644 --- a/data/levels/world1/level18.stl +++ b/data/levels/world1/level18.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level19.stl b/data/levels/world1/level19.stl index 3c63e094a..6291835cb 100644 --- a/data/levels/world1/level19.stl +++ b/data/levels/world1/level19.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level2.stl b/data/levels/world1/level2.stl index d4790d898..b121544b3 100644 --- a/data/levels/world1/level2.stl +++ b/data/levels/world1/level2.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level20.stl b/data/levels/world1/level20.stl index 4555f7256..903f1ad5b 100644 --- a/data/levels/world1/level20.stl +++ b/data/levels/world1/level20.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level21.stl b/data/levels/world1/level21.stl index 1d7192976..81d3c4ea1 100644 --- a/data/levels/world1/level21.stl +++ b/data/levels/world1/level21.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level22.stl b/data/levels/world1/level22.stl index a8a3d7663..92ab45b04 100644 --- a/data/levels/world1/level22.stl +++ b/data/levels/world1/level22.stl @@ -106,7 +106,7 @@ (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)) diff --git a/data/levels/world1/level23.stl b/data/levels/world1/level23.stl index b07960345..c9013752d 100644 --- a/data/levels/world1/level23.stl +++ b/data/levels/world1/level23.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level24.stl b/data/levels/world1/level24.stl index 1dc8fd92e..0b94f1470 100644 --- a/data/levels/world1/level24.stl +++ b/data/levels/world1/level24.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level25.stl b/data/levels/world1/level25.stl index eb5ab79ba..b1a4e019f 100644 --- a/data/levels/world1/level25.stl +++ b/data/levels/world1/level25.stl @@ -108,7 +108,7 @@ (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)) diff --git a/data/levels/world1/level26.stl b/data/levels/world1/level26.stl index 154ec20a4..9958c7a41 100644 --- a/data/levels/world1/level26.stl +++ b/data/levels/world1/level26.stl @@ -106,8 +106,8 @@ (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)) diff --git a/data/levels/world1/level3.stl b/data/levels/world1/level3.stl index 3e71d921b..7cc665560 100644 --- a/data/levels/world1/level3.stl +++ b/data/levels/world1/level3.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level4.stl b/data/levels/world1/level4.stl index ef5e9ac24..6258099bf 100644 --- a/data/levels/world1/level4.stl +++ b/data/levels/world1/level4.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level5.stl b/data/levels/world1/level5.stl index f5db25995..174970a60 100644 --- a/data/levels/world1/level5.stl +++ b/data/levels/world1/level5.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level6.stl b/data/levels/world1/level6.stl index a728abb1e..c0fac7546 100644 --- a/data/levels/world1/level6.stl +++ b/data/levels/world1/level6.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level7.stl b/data/levels/world1/level7.stl index 3e25075a3..4a85e9103 100644 --- a/data/levels/world1/level7.stl +++ b/data/levels/world1/level7.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level8.stl b/data/levels/world1/level8.stl index a40da5e6e..2872957d6 100644 --- a/data/levels/world1/level8.stl +++ b/data/levels/world1/level8.stl @@ -107,7 +107,7 @@ (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)) diff --git a/data/levels/world1/level9.stl b/data/levels/world1/level9.stl index 83b8bfc9f..39a9db075 100644 --- a/data/levels/world1/level9.stl +++ b/data/levels/world1/level9.stl @@ -110,7 +110,7 @@ (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)) diff --git a/src/object/bell.cpp b/src/object/bell.cpp deleted file mode 100644 index 97ba80248..000000000 --- a/src/object/bell.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// $Id$ -// -// SuperTux -// Copyright (C) 2005 Matthias Braun -// -// 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 - -#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 (&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 index 59197236d..000000000 --- a/src/object/bell.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// $Id$ -// -// SuperTux -// Copyright (C) 2005 Matthias Braun -// -// 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 index 000000000..a9278c3d0 --- /dev/null +++ b/src/object/firefly.cpp @@ -0,0 +1,84 @@ +// $Id: Firefly.cpp 2979 2006-01-10 00:00:04Z matzebraun $ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// 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 + +#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 (&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 index 000000000..6f9f02198 --- /dev/null +++ b/src/object/firefly.hpp @@ -0,0 +1,49 @@ +// $Id: bell.hpp 2642 2005-06-26 13:38:53Z matzebraun $ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// 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 +