* Added a boolean "disable-physics" property to powerups. We can't afford losing...
[supertux.git] / src / object / platform.cpp
index 6bc64f4..c0a59a7 100644 (file)
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //  02111-1307, USA.
-
 #include <config.h>
 
 #include "platform.hpp"
+
+#include <iostream>
 #include "video/drawing_context.hpp"
 #include "resources.hpp"
 #include "player.hpp"
@@ -44,6 +45,9 @@ Platform::Platform(const lisp::Lisp& reader)
   flags |= FLAG_SOLID;
 
   path = Path::GetByName(use_path);
+  if (path == NULL) { 
+     std::cerr << "Warning: Path for moving platform not found! Make sure that the name is spelled correctly,\nand that the path is initialized before the platform in the level file!\n";
+  }
 
   path_offset = bbox.p1 - path->GetStart();
 }
@@ -53,6 +57,9 @@ Platform::~Platform()
   delete sprite;
 }
 
+//TODO: Squish Tux when standing between platform and solid tile/object
+//      Improve collision handling
+//      Move all MovingObjects lying on the platform instead of only the player
 HitResponse
 Platform::collision(GameObject& other, const CollisionHit& hit)
 {
@@ -66,12 +73,13 @@ Platform::collision(GameObject& other, const CollisionHit& hit)
   if(other.get_flags() & FLAG_SOLID) {
     //Collision with a solid tile
     //does nothing, because the movement vector isn't used at the moment
+    return ABORT_MOVE;
   }
   return FORCE_MOVE;
 }
 
 void
-Platform::update(float elapsed_time)
+Platform::update(float )
 {
   set_pos(path->GetPosition() + path_offset);
 }