#include "platform.hpp"
-#include <iostream>
+#include "msg.hpp"
#include "video/drawing_context.hpp"
#include "resources.hpp"
#include "player.hpp"
reader.get("x", bbox.p1.x);
reader.get("y", bbox.p1.y);
reader.get("type", type);
- reader.get("use_path", use_path);
+ reader.get("path", use_path);
sprite = sprite_manager->create("images/objects/flying_platform/platform.sprite");
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";
+
+ if (path == NULL) {
+ msg_warning("Path \"" << use_path << "\" for moving platform not found! Make sure that the name is spelled correctly and that the path is initialized before the platform in the level file!");
}
- path_offset = bbox.p1 - path->GetStart();
+ path_offset = bbox.p1;
}
Platform::~Platform()