1
0
mirror of https://github.com/LDDestroier/CC/ synced 2025-01-23 15:36:52 +00:00

Update tron

This commit is contained in:
LDDestroier 2018-11-16 10:36:19 -05:00 committed by GitHub
parent 2f450c6cab
commit cafe3c3005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
tron
View File

@ -397,7 +397,10 @@ local doesIntersectBorder = function(x, y)
end end
--draws grid and background at scroll 'x' and 'y', along with trails and players --draws grid and background at scroll 'x' and 'y', along with trails and players
local drawGrid = function(x, y, onlyDrawGrid) local drawGrid = function(x, y, onlyDrawGrid, useSetVisible)
if useSetVisible then
tsv(false)
end
x, y = mathfloor(x + 0.5), mathfloor(y + 0.5) x, y = mathfloor(x + 0.5), mathfloor(y + 0.5)
local bg = {{},{},{}} local bg = {{},{},{}}
local foreX, foreY local foreX, foreY
@ -467,6 +470,9 @@ local drawGrid = function(x, y, onlyDrawGrid)
termsetCursorPos(1,sy) termsetCursorPos(1,sy)
termblit(bg[1][sy], bg[2][sy], bg[3][sy]) termblit(bg[1][sy], bg[2][sy], bg[3][sy])
end end
if useSetVisible then
tsv(true)
end
end end
local render = function() local render = function()
@ -587,7 +593,7 @@ local makeMenu = function(x, y, options, doAnimate)
end end
elseif evt[1] == "timer" and evt[2] == gstID then elseif evt[1] == "timer" and evt[2] == gstID then
gstID = os.startTimer(0.05) gstID = os.startTimer(0.05)
drawGrid(gsX, gsY, true) drawGrid(gsX, gsY, true, true)
step = step + 1 step = step + 1
if mathceil(step / 100) % 2 == 1 then if mathceil(step / 100) % 2 == 1 then
gsX = gsX + 1 gsX = gsX + 1