From: Stephen Groundwater Date: Sat, 1 Jul 2006 15:01:40 +0000 (+0000) Subject: Added a sound wav for the sector trigger door. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4b2fa8910e302074ac956fabc16348e2ff1b8fe2;p=supertux.git Added a sound wav for the sector trigger door. SVN-Revision: 3830 --- diff --git a/data/sounds/door.wav b/data/sounds/door.wav new file mode 100644 index 000000000..9435e50c9 Binary files /dev/null and b/data/sounds/door.wav differ diff --git a/src/trigger/door.cpp b/src/trigger/door.cpp index d45073fd3..29220d21c 100644 --- a/src/trigger/door.cpp +++ b/src/trigger/door.cpp @@ -28,6 +28,7 @@ #include "video/drawing_context.hpp" #include "lisp/lisp.hpp" #include "lisp/writer.hpp" +#include "audio/sound_manager.hpp" Door::Door(const lisp::Lisp& reader) : state(CLOSED) @@ -71,7 +72,7 @@ Door::write(lisp::Writer& writer) writer.write_string("sector", target_sector); writer.write_string("spawnpoint", target_spawnpoint); - + sound_manager->preload("sounds/door.wav"); writer.end_list("door"); } @@ -86,7 +87,7 @@ Door::update(float ) if(sprite->animation_done()) { state = OPEN; sprite->set_action("open"); - stay_open_timer.start(1.0); + stay_open_timer.start(1.0); } break; case OPEN: @@ -141,6 +142,7 @@ Door::collision(GameObject& other, const CollisionHit& hit) case OPENING: break; case OPEN: +sound_manager->play("sounds/door.wav"); { // if door is open and was touched by a player, teleport the player Player* player = dynamic_cast (&other);