mirror of
https://github.com/LDDestroier/CC/
synced 2025-03-30 07:16:56 +00:00
Update tron.lua
This commit is contained in:
parent
fb71e9a20b
commit
aa16749037
17
tron.lua
17
tron.lua
@ -1311,12 +1311,10 @@ local makeMenu = function(x, fromX, y, options, doAnimate, scrollInfo, _cpos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local gstID, evt
|
|
||||||
if doAnimate then
|
|
||||||
gstID = os.startTimer(0.05)
|
|
||||||
end
|
|
||||||
rend()
|
rend()
|
||||||
local tID = os.startTimer(0.05)
|
local tID = os.startTimer(0.05)
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
evt = {os.pullEvent()}
|
evt = {os.pullEvent()}
|
||||||
if evt[1] == "key" then
|
if evt[1] == "key" then
|
||||||
@ -1345,8 +1343,8 @@ local makeMenu = function(x, fromX, y, options, doAnimate, scrollInfo, _cpos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif evt[1] == "timer" then
|
elseif evt[1] == "timer" then
|
||||||
if evt[2] == gstID then
|
if evt[2] == tID then
|
||||||
gstID = os.startTimer(0.05)
|
tID = os.startTimer(0.05)
|
||||||
drawGrid(gsX, gsY, true)
|
drawGrid(gsX, gsY, true)
|
||||||
step = step + 1
|
step = step + 1
|
||||||
if mathceil(step / 100) % 2 == 1 then
|
if mathceil(step / 100) % 2 == 1 then
|
||||||
@ -1354,16 +1352,11 @@ local makeMenu = function(x, fromX, y, options, doAnimate, scrollInfo, _cpos)
|
|||||||
else
|
else
|
||||||
gsY = gsY - 1
|
gsY = gsY - 1
|
||||||
end
|
end
|
||||||
doRend = true
|
|
||||||
elseif evt[2] == tID then
|
|
||||||
if x > fromX and xmod < x - fromX then
|
if x > fromX and xmod < x - fromX then
|
||||||
xmod = math.min(xmod + 1, x - fromX)
|
xmod = math.min(xmod + 1, x - fromX)
|
||||||
drawGrid(gsX, gsY, true)
|
|
||||||
tID = os.startTimer(0.05)
|
|
||||||
elseif xmod > x - fromX then
|
elseif xmod > x - fromX then
|
||||||
xmod = math.max(xmod - 1, x - fromX)
|
xmod = math.max(xmod - 1, x - fromX)
|
||||||
drawGrid(gsX, gsY, true)
|
|
||||||
tID = os.startTimer(0.05)
|
|
||||||
end
|
end
|
||||||
doRend = true
|
doRend = true
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user