]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/entities.cpp
Added .gitignore to ignore certain files + fixed access rights on Makefile* as
[quix0rs-blobwars.git] / src / entities.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 6828629..4a48160
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -29,7 +30,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
 
        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);
@@ -37,7 +38,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
        }
        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);
        }
 
@@ -61,7 +62,7 @@ void throwAndDamageEntity(Entity *ent, int damage, int minDX, int maxDX, int DY)
 
                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;
                }
 
@@ -320,7 +321,7 @@ void moveEntity(Entity *ent)
 
        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;
                }
@@ -335,7 +336,7 @@ void moveEntity(Entity *ent)
 
        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))
                        {