if (!(ent->flags & ENT_EXPLODES))
{
- audio.playSound(SND_HIT, CH_ANY);
+ audio.playSound(SND_HIT, CH_ANY, ent->x);
for (int i = 0 ; i < 4 ; i++)
{
addBlood(ent, Math::rrand(-5, 5), Math::rrand(-6, -3), i);
}
else
{
- audio.playSound(SND_CLANG, CH_ANY);
+ audio.playSound(SND_CLANG, CH_ANY, ent->x);
addColorParticles(ent->x, ent->y, Math::rrand(25, 75), -1);
}
if (player.health <= 0)
{
- audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH);
+ audio.playSound(SND_DEATH1 + Math::prand() % 3, CH_DEATH, player.x);
player.health = 0;
}
if (ent->dx != 0)
{
- if ((checkBrickContactX(ent)) || (checkObstacleContact(ent, 0)) || (checkTrainContact(ent, 0)))
+ if ((checkBrickContactX(ent)) || (checkObstacleContact(ent, DIR_X)) || (checkTrainContact(ent, DIR_X)))
{
ent->dx = 0;
}
if (ent->dy != 0)
{
- if ((checkBrickContactY(ent)) || (checkObstacleContact(ent, 1)) || (checkTrainContact(ent, 1)))
+ if ((checkBrickContactY(ent)) || (checkObstacleContact(ent, DIR_Y)) || (checkTrainContact(ent, DIR_Y)))
{
if ((ent->flags & ENT_BOUNCES) && (ent->dy >= 3))
{