Update tron

This commit is contained in:
LDDestroier 2018-11-14 16:42:14 -05:00 committed by GitHub
parent 344eee2d7a
commit bb64f8ebc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

4
tron
View File

@ -482,9 +482,9 @@ local makeMenu = function(x, y, options)
evt = {os.pullEvent()}
if evt[1] == "key" then
if evt[2] == keys.up then
cpos = math.max(cpos - 1, 1)
cpos = (cpos - 1) % #options
elseif evt[2] == keys.down then
cpos = math.min(cpos + 1, #options)
cpos = (cpos % #options) + 1
elseif evt[2] == keys.enter then
return cpos
end