mirror of
https://github.com/LDDestroier/CC/
synced 2024-10-31 23:26:19 +00:00
Update tron
This commit is contained in:
parent
81e6eaaa07
commit
0fd157f1bf
6
tron
6
tron
@ -299,6 +299,7 @@ end
|
||||
local deadGuys = {}
|
||||
local trail = {}
|
||||
local lastTrails = {}
|
||||
isPuttingDown = false
|
||||
|
||||
local putTrailXY = function(x, y, p)
|
||||
trail[y] = trail[y] or {}
|
||||
@ -695,6 +696,7 @@ end
|
||||
local sendInfo = function(gameID)
|
||||
transmit(port, {
|
||||
player = isHost and player or nil,
|
||||
putTrail = isPuttingDown,
|
||||
gameID = gameID,
|
||||
keysDown = isHost and nil or keysDown,
|
||||
trail = isHost and lastTrails or nil,
|
||||
@ -801,10 +803,11 @@ local game = function()
|
||||
if isHost then
|
||||
setDirection(p, nil, control[lastDirectionPressed])
|
||||
setDirection(np, nil, control[netLastDirectionPressed])
|
||||
p.putTrail = not keysDown[control.release]
|
||||
else
|
||||
setDirection(p, nil, control[lastDirectionPressed])
|
||||
isPuttingDown = not keysDown[control.release]
|
||||
end
|
||||
p.putTrail = not keysDown[control.release]
|
||||
|
||||
if keysDown[control.lookLeft] then
|
||||
scrollAdjX = scrollAdjX - 2
|
||||
@ -885,6 +888,7 @@ local networking = function()
|
||||
elseif type(msg.keysDown) == "table" then
|
||||
netKeysDown = msg.keysDown
|
||||
netLastDirectionPressed = msg.lastDir
|
||||
player[nou].putTrail = msg.putTrail
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user