a first implementation of doors to switch between sectors
[supertux.git] / src / physic.cpp
index edd976c..ef6d94c 100644 (file)
@@ -24,7 +24,7 @@
 #include "defines.h"
 #include "physic.h"
 #include "timer.h"
-#include "world.h"
+#include "sector.h"
 #include "level.h"
 
 Physic::Physic()
@@ -46,7 +46,7 @@ Physic::reset()
 void
 Physic::set_velocity_x(float nvx)
 {
-  vx = -nvx;
+  vx = nvx;
 }
 
 void
@@ -58,8 +58,8 @@ Physic::set_velocity_y(float nvy)
 void
 Physic::set_velocity(float nvx, float nvy)
 {
-    vx = nvx;
-    vy = -nvy;
+  vx = nvx;
+  vy = -nvy;
 }
 
 void Physic::inverse_velocity_x()
@@ -85,6 +85,18 @@ Physic::get_velocity_y()
 }
 
 void
+Physic::set_acceleration_x(float nax)
+{
+  ax = nax;
+}
+
+void
+Physic::set_acceleration_y(float nay)
+{
+  ay = -nay;
+}
+
+void
 Physic::set_acceleration(float nax, float nay)
 {
     ax = nax;
@@ -112,7 +124,7 @@ Physic::enable_gravity(bool enable_gravity)
 void
 Physic::apply(float frame_ratio, float &x, float &y)
 {
-  float gravity = World::current()->get_level()->gravity;
+  float gravity = Sector::current()->gravity;
   float grav;
   if(gravity_enabled)
     grav = gravity / 100.0;