Russian translation update from Constantin Baranov... from December.
[supertux.git] / src / badguy / kugelblitz.cpp
index 0d14a5a..813492d 100644 (file)
@@ -34,11 +34,11 @@ static const float X_OFFSCREEN_DISTANCE = 1600;
 static const float Y_OFFSCREEN_DISTANCE = 1200;
 
 Kugelblitz::Kugelblitz(const lisp::Lisp& reader)
-    : BadGuy(Vector(0,0), "images/creatures/kugelblitz/kugelblitz.sprite"), groundhit_pos_set(false)
+    : BadGuy(reader, "images/creatures/kugelblitz/kugelblitz.sprite"), groundhit_pos_set(false)
 {
   reader.get("x", start_position.x);
   sprite->set_action("falling");
-  physic.gravity_enabled = false;
+  physic.enable_gravity(false);
 }
 
 void
@@ -52,10 +52,10 @@ Kugelblitz::write(lisp::Writer& writer)
 }
 
 void
-Kugelblitz::activate()
+Kugelblitz::initialize()
 {
-  physic.vy = 300;
-  physic.vx = -20; //fall a little to the left
+  physic.set_velocity_y(300);
+  physic.set_velocity_x(-20); //fall a little to the left
   direction = 1;
   dying = false;
 }
@@ -107,16 +107,16 @@ Kugelblitz::hit(const CollisionHit& hit)
       groundhit_pos_set = true;
     }
     sprite->set_action("flying");
-    physic.vy = 0;
+    physic.set_velocity_y(0);
     //Set random initial speed and direction
     direction = systemRandom.rand(2)? 1: -1;
     int speed = (BASE_SPEED + (systemRandom.rand(RAND_SPEED))) * direction;
-    physic.vx = speed;
+    physic.set_velocity_x(speed);
     movement_timer.start(MOVETIME);
     lifetime.start(LIFETIME);
 
   } else if(hit.top) { // bumped on roof
-    physic.vy = 0;
+    physic.set_velocity_y(0);
   }
 
   return CONTINUE;
@@ -133,7 +133,7 @@ Kugelblitz::active_update(float elapsed_time)
       if (movement_timer.check()) {
         if (direction == 1) direction = -1; else direction = 1;
         int speed = (BASE_SPEED + (systemRandom.rand(RAND_SPEED))) * direction;
-        physic.vx = speed;
+        physic.set_velocity_x(speed);
         movement_timer.start(MOVETIME);
       }
     }
@@ -163,7 +163,7 @@ Kugelblitz::explode()
 {
   if (!dying) {
     sprite->set_action("pop");
-    lifetime.start(0.2);
+    lifetime.start(0.2f);
     dying = true;
   }
   else remove_me();