From 0fd157f1bf589635f4614204e92c9071aa573048 Mon Sep 17 00:00:00 2001 From: LDDestroier Date: Fri, 16 Nov 2018 15:52:36 -0500 Subject: [PATCH] Update tron --- tron | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tron b/tron index b3e0ee8..ff9e097 100644 --- a/tron +++ b/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