#include "sprite/sprite.hpp"
#include "supertux/object_factory.hpp"
#include "supertux/sector.hpp"
+#include "util/reader.hpp"
+
+#include <sstream>
+#include <stdexcept>
namespace {
const std::string BUTTON_SOUND = "sounds/switch.ogg";
}
PushButton::PushButton(const Reader& lisp) :
- MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING),
+ MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING),
script(),
state(OFF)
{
- sound_manager->preload(BUTTON_SOUND);
+ SoundManager::current()->preload(BUTTON_SOUND);
set_action("off", -1);
bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
set_pos(get_pos() + Vector(0, old_bbox_height - new_bbox_height));
// play sound
- sound_manager->play(BUTTON_SOUND);
+ SoundManager::current()->play(BUTTON_SOUND);
// run script
std::istringstream stream(script);
return FORCE_MOVE;
}
-IMPLEMENT_FACTORY(PushButton, "pushbutton");
-
/* EOF */