+ : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC),
+ speed(Vector(0,0)),
+ automatic(false), player_contact(false), last_player_contact(false)
+{
+ bool running = true;
+ reader.get("name", name);
+ reader.get("running", running);
+ if ((name == "") && (!running)) automatic=true;
+ const lisp::Lisp* pathLisp = reader.get_lisp("path");
+ if(pathLisp == NULL)
+ throw std::runtime_error("No path specified for platform");
+ path.reset(new Path());
+ path->read(*pathLisp);
+ walker.reset(new PathWalker(path.get(), running));
+ bbox.set_pos(path->get_base());
+}
+
+Platform::Platform(const Platform& other)
+ : MovingSprite(other), ScriptInterface(other),
+ speed(other.speed),
+ automatic(other.automatic), player_contact(false), last_player_contact(false)
+{
+ name = other.name;
+ path.reset(new Path(*other.path));
+ walker.reset(new PathWalker(*other.walker));
+ walker->path = &*path;
+}
+
+HitResponse
+Platform::collision(GameObject& other, const CollisionHit& )
+{
+ if (dynamic_cast<Player*>(&other)) player_contact = true;
+ return FORCE_MOVE;
+}
+
+void
+Platform::update(float elapsed_time)