[Super-tux-commit] supertux/src badguy.cpp,1.48,1.49 sound.cpp,1.11,1.12 sound.h,1.24,1.25
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-04-22 21:51:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5864/src Modified Files: badguy.cpp sound.cpp sound.h Log Message: Implemented explosion sound when Mr.Bomb explodes. It uses the current stereo system that is kinda of primitive. We should base it on player's coordinates and calculate it according it. Instead, it bases the screen, besides it is not even calculated, just use some constants. Index: sound.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- sound.cpp 22 Apr 2004 11:17:34 -0000 1.11 +++ sound.cpp 22 Apr 2004 21:51:19 -0000 1.12 @@ -47,7 +47,8 @@ "/sounds/shoot.wav", "/sounds/lifeup.wav", "/sounds/stomp.wav", - "/sounds/kick.wav" + "/sounds/kick.wav", + "/sounds/explode.wav" }; Index: sound.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- sound.h 21 Apr 2004 23:38:05 -0000 1.24 +++ sound.h 22 Apr 2004 21:51:19 -0000 1.25 @@ -67,6 +67,7 @@ SND_LIFEUP, SND_STOMP, SND_KICK, + SND_EXPLODE, NUM_SOUNDS }; Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- badguy.cpp 22 Apr 2004 19:53:17 -0000 1.48 +++ badguy.cpp 22 Apr 2004 21:51:19 -0000 1.49 @@ -481,6 +481,15 @@ set_sprite(img_mrbomb_explosion, img_mrbomb_explosion); dying = DYING_NOT; // now the bomb hurts timer.start(EXPLODETIME); + + /* play explosion sound */ // FIXME: is the stereo all right? maybe we should use player cordinates... + if (base.x < scroll_x + screen->w/2 - 10) + play_sound(sounds[SND_EXPLODE], SOUND_LEFT_SPEAKER); + else if (base.x > scroll_x + screen->w/2 + 10) + play_sound(sounds[SND_EXPLODE], SOUND_RIGHT_SPEAKER); + else + play_sound(sounds[SND_EXPLODE], SOUND_CENTER_SPEAKER); + } else if(mode == BOMB_EXPLODE) { remove_me(); return; |