}
PushButton::PushButton(const lisp::Lisp& lisp)
- : MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), state(OFF)
+ : MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), state(OFF)
{
sound_manager->preload(BUTTON_SOUND);
set_action("off", -1);
{
Player* player = dynamic_cast<Player*>(&other);
if (!player) return FORCE_MOVE;
- float vy = player->physic.vy;
+ float vy = player->physic.get_velocity_y();
//player->add_velocity(Vector(0, -150));
- player->physic.vy = -150;
+ player->physic.set_velocity_y(-150);
if (state != OFF) return FORCE_MOVE;
if (!hit.top) return FORCE_MOVE;
// play sound
sound_manager->play(BUTTON_SOUND);
-
+
// run script
std::istringstream stream(script);
Sector::current()->run_script(stream, "PushButton");
}
IMPLEMENT_FACTORY(PushButton, "pushbutton");
-