Can set firefly's sprite.
authorWolfgang Becker <uafr@gmx.de>
Tue, 4 Jul 2006 22:18:02 +0000 (22:18 +0000)
committerWolfgang Becker <uafr@gmx.de>
Tue, 4 Jul 2006 22:18:02 +0000 (22:18 +0000)
SVN-Revision: 3885

src/object/firefly.cpp

index b9b7759..a924e35 100644 (file)
 #include "object/sprite_particle.hpp"
 
 Firefly::Firefly(const lisp::Lisp& lisp)
-       : MovingSprite(lisp, "images/objects/firefly/firefly.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false)
+       : MovingSprite(lisp, "images/objects/firefly/firefly.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false)
 {
+  
+  if( !lisp.get( "sprite", sprite_name ) ){
+    return;
+  }
+  if( sprite_name == "" ){
+    sprite_name = "images/objects/firefly/firefly.sprite";
+    return;
+  }
+  //Replace sprite 
+  sprite = sprite_manager->create( sprite_name );
+  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
 }
 
 void