Weird Question
Posted: Sun Nov 16, 2014 7:39 am
I have a bit of code that check if the players and enemies are colliding, if they are it subtracts the player attack from the enemy health and the enemy attack from the player health. It does this ones every 20 ticks. if i make both the player and enemy attack the same and make their health the same, then they should kill each other evenly right? They don't.
if i have this
The players always win.
if i have this
The enemies always win.
If i spawn less than 5 at a time, they kill each other like they should. Anything over 5 and the above problem happens.
The reason might be obvious but i'm not seeing it.
Thanks in advance
Right click to spawn Enemies
Left click to spawn Players
if i have this
Code: Select all
for i,v in ipairs(enemies) do
for ii,vv in ipairs(players) do...
if i have this
Code: Select all
for i,v in ipairs(players) do
for ii,vv in ipairs(enemies) do...
If i spawn less than 5 at a time, they kill each other like they should. Anything over 5 and the above problem happens.
The reason might be obvious but i'm not seeing it.
Thanks in advance
Right click to spawn Enemies
Left click to spawn Players