Added a sound wav for the sector trigger door.
authorStephen Groundwater <slacker@gluebox.com>
Sat, 1 Jul 2006 15:01:40 +0000 (15:01 +0000)
committerStephen Groundwater <slacker@gluebox.com>
Sat, 1 Jul 2006 15:01:40 +0000 (15:01 +0000)
SVN-Revision: 3830

data/sounds/door.wav [new file with mode: 0644]
src/trigger/door.cpp

diff --git a/data/sounds/door.wav b/data/sounds/door.wav
new file mode 100644 (file)
index 0000000..9435e50
Binary files /dev/null and b/data/sounds/door.wav differ
index d45073f..29220d2 100644 (file)
@@ -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<Player*> (&other);