Skip to content

Commit

Permalink
Add slide sound (fixes #106)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Jun 25, 2013
1 parent 3be3605 commit 36891a7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions sounds/slide.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Derived from Sand paper rub.mp3 by orginaljun
orginaljun.deviantart.com
http://freesound.org/people/orginaljun/sounds/157832/

http://creativecommons.org/licenses/by/3.0/
Binary file added sounds/slide.wav
Binary file not shown.
6 changes: 6 additions & 0 deletions src/cdogs/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,12 @@ void SlideActor(TActor * actor, int cmd)

actor->dx = dx;
actor->dy = dy;

// Slide sound
if (gConfig.Sound.Footsteps)
{
SoundPlayAt(SND_SLIDE, actor->tileItem.x, actor->tileItem.y);
}
}

void UpdateAllActors(int ticks)
Expand Down
5 changes: 3 additions & 2 deletions src/cdogs/sounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ SoundDevice gSoundDevice =
{"sounds/whistle.wav", 0, NULL},
{"sounds/powergun.wav", 0, NULL},
{"sounds/mg.wav", 0, NULL},
{"sounds/footstep.wav", 0, NULL},
{"sounds/shotgun_r.wav", 0, NULL},
{"sounds/powergun_r.wav", 0, NULL},
{"sounds/package_r.wav", 0, NULL},
Expand All @@ -96,7 +95,9 @@ SoundDevice gSoundDevice =
{"sounds/hit_flesh.wav", 0, NULL},
{"sounds/hit_gas.wav", 0, NULL},
{"sounds/hit_hard.wav", 0, NULL},
{"sounds/hit_petrify.wav", 0, NULL}
{"sounds/hit_petrify.wav", 0, NULL},
{"sounds/footstep.wav", 0, NULL},
{"sounds/slide.wav", 0, NULL}
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/cdogs/sounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ typedef enum
SND_DONE,
SND_LASER,
SND_MINIGUN,
SND_FOOTSTEP,
SND_SHOTGUN_R,
SND_LASER_R,
SND_PACKAGE_R,
Expand All @@ -85,6 +84,8 @@ typedef enum
SND_HIT_GAS,
SND_HIT_HARD,
SND_HIT_PETRIFY,
SND_FOOTSTEP,
SND_SLIDE,
SND_COUNT
} sound_e;

Expand Down

0 comments on commit 36891a7

Please sign in to comment.