Code Editing Tutorials
Adding a heartbeat sound

Step 1.Open WL_PLAY.C and search for "funny face". Now you should find:

//
// MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE
//
#ifdef SPEAR
funnyticount += tics;
if (funnyticount > 30l*70)
{
funnyticount = 0;
StatusDrawPic (17,4,BJWAITING1PIC+(US_RndT()&1));
facecount = 0;
}
#endif

Step 2. Change this all to the following(copy paste). Then save and compile.

//
// PLAY HEARTBEAT SOUND IF HEALTH IS BELOW 51%
//
#ifndef SPEAR
if (gamestate.health<51)
{
funnyticount += tics;
if (funnyticount > 30l*3) // heartbeat speed -- change to your liking
{
funnyticount = 0;
SD_PlaySound (HEARTBEATSND);
}
 }
#endif

Get back to the Dome tutorials
Jump to the top