Magic Blocks. (DrawingContext::get_light is not working yet.)
[supertux.git] / src / object / oneup.cpp
index 3b45a63..bdbaa5e 100644 (file)
 #include "sector.hpp"
 #include "video/drawing_context.hpp"
 
-OneUp::OneUp(const Vector& pos)
+OneUp::OneUp(const Vector& pos, Direction direction)
        : MovingSprite(pos, "images/powerups/1up/1up.sprite", LAYER_FLOATINGOBJECTS, COLGROUP_TOUCHABLE)
 {
-  physic.set_velocity(100, -400);
+  physic.set_velocity((direction == LEFT)?-100:100, -400);
 }
 
 void
@@ -38,7 +38,7 @@ OneUp::update(float elapsed_time)
   if(!Sector::current()->inside(bbox))
     remove_me();
 
-  movement = physic.get_movement(elapsed_time); 
+  movement = physic.get_movement(elapsed_time);
 }
 
 HitResponse
@@ -52,4 +52,3 @@ OneUp::collision(GameObject& other, const CollisionHit& )
   }
   return FORCE_MOVE;
 }
-