[ Patch #1793 ] Turn physic into POD
[supertux.git] / src / object / growup.cpp
index 1d256db..4a6e0ce 100644 (file)
@@ -30,8 +30,8 @@
 GrowUp::GrowUp(Direction direction)
        : MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
 {
-  physic.enable_gravity(true);
-  physic.set_velocity_x((direction == LEFT)?-100:100);
+  physic.gravity_enabled = true;
+  physic.vx = (direction == LEFT?-100:100);
   sound_manager->preload("sounds/grow.wav");
 }
 
@@ -45,9 +45,9 @@ void
 GrowUp::collision_solid(const CollisionHit& hit)
 {
   if(hit.top || hit.bottom)
-    physic.set_velocity_y(0);
+    physic.vy = 0;
   if(hit.left || hit.right)
-    physic.set_velocity_x(-physic.get_velocity_x());
+    physic.vx = -physic.vx;
 }
 
 HitResponse