}
Door::Door(int x, int y, std::string sector, std::string spawnpoint)
}
Door::Door(int x, int y, std::string sector, std::string spawnpoint)
writer.write_float("y", bbox.p1.y);
writer.write_float("width", bbox.get_width());
writer.write_float("height", bbox.get_height());
writer.write_float("y", bbox.p1.y);
writer.write_float("width", bbox.get_width());
writer.write_float("height", bbox.get_height());
writer.write_string("sector", target_sector);
writer.write_string("spawnpoint", target_spawnpoint);
sound_manager->preload("sounds/door.wav");
writer.write_string("sector", target_sector);
writer.write_string("spawnpoint", target_spawnpoint);
sound_manager->preload("sounds/door.wav");
// if door was activated, start opening it
if (type == EVENT_ACTIVATE) {
state = OPENING;
// if door was activated, start opening it
if (type == EVENT_ACTIVATE) {
state = OPENING;
{
// if door is open and was touched by a player, teleport the player
Player* player = dynamic_cast<Player*> (&other);
{
// if door is open and was touched by a player, teleport the player
Player* player = dynamic_cast<Player*> (&other);