mirror of
https://github.com/LDDestroier/CC/
synced 2024-12-13 19:50:29 +00:00
Fixed head-on collisions being considered ties
This commit is contained in:
parent
03d0d83b62
commit
3576ee74f2
25
tron
25
tron
@ -654,21 +654,24 @@ local moveTick = function(doSend)
|
|||||||
if isHost then
|
if isHost then
|
||||||
p.x = p.x + math.floor(math.cos(math.rad(p.direction * 90)))
|
p.x = p.x + math.floor(math.cos(math.rad(p.direction * 90)))
|
||||||
p.y = p.y + math.floor(math.sin(math.rad(p.direction * 90)))
|
p.y = p.y + math.floor(math.sin(math.rad(p.direction * 90)))
|
||||||
|
if doesIntersectBorder(p.x, p.y) or getTrail(p.x, p.y) then
|
||||||
|
p.dead = true
|
||||||
|
deadGuys[i] = true
|
||||||
|
elseif p.putTrail then
|
||||||
|
putTrail(p)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
for a = 1, #player do
|
||||||
if isHost then
|
if (a ~= i) and (player[a].x == p.x and player[a].y == p.y) then
|
||||||
if p.putTrail then
|
p.dead = true
|
||||||
putTrail(p)
|
player[a].dead = true
|
||||||
|
deadGuys[i] = true
|
||||||
|
deadGuys[a] = true
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for i = 1, #player do
|
|
||||||
p = player[i]
|
|
||||||
if getTrail(p.x, p.y) or doesIntersectBorder(p.x, p.y) then
|
|
||||||
p.dead = true
|
|
||||||
deadGuys[i] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
ageTrails()
|
ageTrails()
|
||||||
return deadAnimation(doSend)
|
return deadAnimation(doSend)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user