updated dispenser -- can summon mriceblock, snowball, bouncing_snowball and mrbomb now
[supertux.git] / src / badguy / snowball.cpp
index ac9b277..de77435 100644 (file)
@@ -8,16 +8,19 @@ SnowBall::SnowBall(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("snowball");
+  set_direction = false;
 }
 
-SnowBall::SnowBall(float pos_x, float pos_y)
+SnowBall::SnowBall(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("snowball");
+  set_direction = true;
+  initial_direction = d;
 }
 
 void
@@ -34,6 +37,7 @@ SnowBall::write(LispWriter& writer)
 void
 SnowBall::activate()
 {
+  if (set_direction) {dir = initial_direction;}
   physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
   sprite->set_action(dir == LEFT ? "left" : "right");
 }