From: Matthias Braun Date: Sat, 26 May 2007 17:02:21 +0000 (+0000) Subject: use the tree sounds X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0367f6faa0e560086bcb48e352616759b8c6b137;p=supertux.git use the tree sounds SVN-Revision: 5030 --- diff --git a/src/badguy/ghosttree.cpp b/src/badguy/ghosttree.cpp index 917345b7f..250e05e4c 100644 --- a/src/badguy/ghosttree.cpp +++ b/src/badguy/ghosttree.cpp @@ -51,6 +51,8 @@ GhostTree::active_update(float elapsed_time) (void) elapsed_time; if(colorchange_timer.check()) { + sound_manager->play("sounds/tree_howling.ogg", get_pos()); + suck_timer.start(3); treecolor = (treecolor + 1) % 3; Color col; @@ -64,6 +66,11 @@ GhostTree::active_update(float elapsed_time) default: assert(false); } sprite->set_color(col); + } + + if(suck_timer.check()) { + Color col = sprite->get_color(); + sound_manager->play("sounds/tree_suck.ogg", get_pos()); std::vector::iterator iter; for(iter = willowisps.begin(); iter != willowisps.end(); ++iter) { TreeWillOWisp *willo = *iter; diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index 109ba3d25..d451c389d 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -42,6 +42,7 @@ private: int willo_color; Timer colorchange_timer; + Timer suck_timer; Timer root_timer; int treecolor;