- std::string use_path;
- std::string type;
-
- reader.get("x", bbox.p1.x);
- reader.get("y", bbox.p1.y);
- reader.get("type", type);
- reader.get("use_path", use_path);
- sprite = sprite_manager->create("platform");
- sprite->set_action(type);
- bbox.set_size(sprite->get_width(), sprite->get_height());
-
- 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();
+ 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());