From ed857c9b9d79e963b1443e30cfed9fa0bcdb1cc2 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Thu, 22 Jun 2006 14:50:56 +0000 Subject: [PATCH] Added ticking sound (self-made, public domain) for Bomb SVN-Revision: 3694 --- data/sounds/ticking.wav | Bin 0 -> 8366 bytes src/badguy/bomb.cpp | 22 ++++++++++++++++++++++ src/badguy/bomb.hpp | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 data/sounds/ticking.wav diff --git a/data/sounds/ticking.wav b/data/sounds/ticking.wav new file mode 100644 index 0000000000000000000000000000000000000000..3dbf6ea664c3812e7a48a246931082a47f70f56d GIT binary patch literal 8366 zcmZWu33wG%vaafTZ}vby2@t}72$%`_BwM@&#C(BuR3))rz(#O z88m1^dw}%RF$1SepVK}D0FZy0bphxw2Ec+CcxKX^Nw2VsLy3?<-CzR^w`Ni|e`Od( z9=i6PH{bV2?c*U~<{)(OCBPGb?E0qRPTl74#ny(}8P-$IA^g;1H&oUijMx!+qv8S2 zTHo^O)T=b~sZ_v1f?q$>5RNdfyWJ zT;wx&EtnYkhpHBkWBnEm;f%2P_Wf1+LRQleN{tu>IsV=7y!A_BIHM6&>&p)b8}`Jb|W@ZKG`-@C}SzWzZo zBK+>Eqai8LQ>(@VlB0gKC)tZ4r&W__9v*2G`ZF;V`qqW{T7`e!(5~)eSb>vfevRy5 zU$H;)#!zPc-#lx4gPiG}SIo@%38uMk6(!?*?-COc-05xRJ>Uc|%(L2wp%vI*lifaS z2CN7mKHREhaZYVUuhfc+OQ~Zg)L~X)>ofPxjal}a5yvK64tRz{|0z1VV&>I#iOqdE z*ZQ8D*T1r4TI-Ue-|y+`=@7B;>!_sPH%+{{w$CLdPJk6Tpv>38X|cm8ISsgB$fmUX;c%}c)dxA%!@ zQnT6QT-$SbyysfygC4NHu-BccvYwBhVRyAkn-|xfv%mFBul(-vmKF)|FZqv!RM-CT zyFT8DiAkPC4Np2hm-WZk+viws;Ir15>N%!;$YuL&`_a(k&_T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dxxc)CQTef8mxSvJ?ynY~*iOvx~-!~n8KZb;jo=b%q9N&zZwSPSn$yvu7OLq3Qwav?o3UA zlUyt3(|PVoNS&iPVu}vl9rv#{rzVdnuZ`8URnQ<#pWSvhWnI$Oilj^5Fu$ZX#(D<$*LOYlnesUIH^6)-gTv68 zp5+)8(OgpkAJAE6DJ&&^OF=rkPxo?nvKzbwsj!~&Du=r|L$Hi_P36wiR7im@%sT49 zUCvAxg|RrCJE5t(BE@u>yPjU|xlDm&(4V%Nx48#+f;#h>rf}zA1U*Kdmu)B^kS3IO+J2Jpym z&ai5V=NwAlNXKy&CG-D4X2B)y`sQ)Bq?~!C@XEHOT&OAbF>d`utvC29ik&c^A&+Ol(bSXehkIQHtlWSNLu8 zJjbPs+2uhG?z24(+1$~LrFa<1U9ns^MnmWTe8#=DJ&d2t{>@^vTF$(2oC8_B|L%br z?h1{j>D+(5#&3&{X%`jJH@xS+WR8!~544W%fDpKsy-48R(6@9q_mXbsPEl7r+j#jr zBqv(;RCMd7p4If6Bqwc=k`s_Cqo-auo!e323RF0!z2=ah@AqpqIF z36gx1xahnva6M3VnnQvqy6TVe6K#Rv87QINr{B| z)VP9*pi*)d{ae{-)P$92s-;`wCOUEnwpi1ShM>yjvJpMORUZ_^otH7;uHWU}s4bGZ Nf{i>~79uC8{|i@drRe|w literal 0 HcmV?d00001 diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index 17ae15565..e765869d8 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -32,6 +32,26 @@ Bomb::Bomb(const Vector& pos, Direction dir) this->dir = dir; sprite->set_action(dir == LEFT ? "ticking-left" : "ticking-right"); countMe = false; + + ticking.reset(sound_manager->create_sound_source("sounds/ticking.wav")); + ticking->set_position(get_pos()); + ticking->set_looping(true); + ticking->set_gain(2.0); + ticking->set_reference_distance(32); + ticking->play(); +} + +Bomb::Bomb(const Bomb& other) + : BadGuy(other), state(other.state), timer(other.timer) +{ + if (state == STATE_TICKING) { + ticking.reset(sound_manager->create_sound_source("sounds/ticking.wav")); + ticking->set_position(get_pos()); + ticking->set_looping(true); + ticking->set_gain(2.0); + ticking->set_reference_distance(32); + ticking->play(); + } } void @@ -71,6 +91,7 @@ Bomb::active_update(float ) { switch(state) { case STATE_TICKING: + ticking->set_position(get_pos()); if(timer.check()) { explode(); } @@ -86,6 +107,7 @@ Bomb::active_update(float ) void Bomb::explode() { + ticking->stop(); state = STATE_EXPLODING; set_group(COLGROUP_TOUCHABLE); sprite->set_action("explosion"); diff --git a/src/badguy/bomb.hpp b/src/badguy/bomb.hpp index abd8b9d06..0bbe1c4f9 100644 --- a/src/badguy/bomb.hpp +++ b/src/badguy/bomb.hpp @@ -26,6 +26,7 @@ class Bomb : public BadGuy { public: Bomb(const Vector& pos, Direction dir); + Bomb(const Bomb& bomb); void write(lisp::Writer& writer); HitResponse collision_solid(GameObject& other, const CollisionHit& hit); @@ -45,6 +46,9 @@ private: State state; Timer timer; + + std::auto_ptr ticking; + }; #endif -- 2.11.0