1
0
mirror of https://github.com/LDDestroier/CC/ synced 2025-09-05 04:17:59 +00:00

Update tron

This commit is contained in:
LDDestroier
2018-11-15 01:16:45 -05:00
committed by GitHub
parent cf5a4a5b36
commit 19b7c36be6

21
tron
View File

@@ -651,16 +651,21 @@ local moveTick = function(doSend)
for i = 1, #player do for i = 1, #player do
p = player[i] p = player[i]
if not p.dead then if not p.dead then
if isHost then if getTrail(p.x, p.y) or doesIntersectBorder(p.x, p.y) then
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)))
end
if getTrail(p.x, p.y) or (p.x == grid.x1 or p.x == grid.x2 or p.y == grid.y1 or p.y == grid.y2) then
p.dead = true p.dead = true
deadGuys[i] = true deadGuys[i] = true
elseif isHost then else
if p.putTrail then if isHost then
putTrail(p) 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)))
end
if getTrail(p.x, p.y) or doesIntersectBorder(p.x, p.y) then
p.dead = true
deadGuys[i] = true
elseif isHost then
if p.putTrail then
putTrail(p)
end
end end
end end
end end