Badguys read hitbox from .sprite file
[supertux.git] / src / badguy / bouncing_snowball.cpp
index 0633b5f..ba9536a 100644 (file)
@@ -28,8 +28,8 @@ BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader)
 {
   reader.get("x", start_position.x);
   reader.get("y", start_position.y);
-  bbox.set_size(31.8, 31.8);
   sprite = sprite_manager->create("images/creatures/bouncing_snowball/bouncing_snowball.sprite");
+  bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
   set_direction = false;
 }
 
@@ -37,8 +37,8 @@ BouncingSnowball::BouncingSnowball(float pos_x, float pos_y, Direction d)
 {
    start_position.x = pos_x;
    start_position.y = pos_y;
-   bbox.set_size(31.8, 31.8);
    sprite = sprite_manager->create("images/creatures/bouncing_snowball/bouncing_snowball.sprite");
+   bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
    set_direction = true;
    initial_direction = d;
 }