fixed background drawing problems introduced with my last commit
[supertux.git] / src / badguy / bouncing_snowball.cpp
index 4f9334d..26a9534 100644 (file)
@@ -9,16 +9,19 @@ BouncingSnowball::BouncingSnowball(LispReader& reader)
 {
   reader.read_float("x", start_position.x);
   reader.read_float("y", start_position.y);
-  bbox.set_size(32, 32);
+  bbox.set_size(31.8, 31.8);
   sprite = sprite_manager->create("bouncingsnowball");
+  set_direction = false;
 }
 
-BouncingSnowball::BouncingSnowball(float pos_x, float pos_y)
+BouncingSnowball::BouncingSnowball(float pos_x, float pos_y, Direction d)
 {
    start_position.x = pos_x;
    start_position.y = pos_y;
-   bbox.set_size(32, 32);
+   bbox.set_size(31.8, 31.8);
    sprite = sprite_manager->create("bouncingsnowball");
+   set_direction = true;
+   initial_direction = d;
 }
 
 void
@@ -35,6 +38,7 @@ BouncingSnowball::write(LispWriter& writer)
 void
 BouncingSnowball::activate()
 {
+  if (set_direction) {dir = initial_direction;}
   physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
   sprite->set_action(dir == LEFT ? "left" : "right");
 }