Use svnversion program rather than finding the svn package to get revision number
[supertux.git] / src / badguy / bouncing_snowball.cpp
index b28b03e..2d90433 100644 (file)
@@ -25,7 +25,7 @@ static const float JUMPSPEED = -450;
 static const float WALKSPEED = 80;
 
 BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader)
-       : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
+        : BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
 {
 }
 
@@ -46,9 +46,9 @@ BouncingSnowball::write(lisp::Writer& writer)
 }
 
 void
-BouncingSnowball::activate()
+BouncingSnowball::initialize()
 {
-  physic.vx = (dir == LEFT ? -WALKSPEED : WALKSPEED);
+  physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
   sprite->set_action(dir == LEFT ? "left" : "right");
 }
 
@@ -65,18 +65,18 @@ BouncingSnowball::collision_solid(const CollisionHit& hit)
 {
   if(hit.bottom) {
     if(get_state() == STATE_ACTIVE) {
-      physic.vy = JUMPSPEED;
+      physic.set_velocity_y(JUMPSPEED);
     } else {
-      physic.vy = 0;
+      physic.set_velocity_y(0);
     }
   } else if(hit.top) {
-    physic.vy = 0;
+    physic.set_velocity_y(0);
   }
 
   if(hit.left || hit.right) { // left or right collision
     dir = dir == LEFT ? RIGHT : LEFT;
     sprite->set_action(dir == LEFT ? "left" : "right");
-    physic.vx = -physic.vx;
+    physic.set_velocity_x(-physic.get_velocity_x());
   }
 }