Abbreviated debug info

I also wanted to work on a title screen, but ran out of steam before really starting.
This commit is contained in:
LDDestroier 2021-01-20 23:04:21 -05:00 committed by GitHub
parent 4b2ecc6926
commit 11110c531f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 7 deletions

View File

@ -94,6 +94,10 @@ local switch = function(check)
end
end
local roundToPlaces = function(number, places)
return math.floor(number * 10^places) / (10^places)
end
-- current state of the game; can be used to perfectly recreate the current scene of a game
-- that includes board and mino objects, bitch
gameState = {}
@ -906,16 +910,13 @@ StartGame = function()
-- debug info
term.setCursorPos(2, scr_y - 2)
term.clearLine()
term.write("Lines cleared: " .. gameState.linesCleared)
term.write("Lines: " .. gameState.linesCleared .. " ")
term.setCursorPos(2, scr_y - 1)
term.clearLine()
term.write("Moves: " .. mino.movesLeft .. ", TimeToLock: " .. mino.lockTimer)
term.write("M=" .. mino.movesLeft .. ", TTL=" .. tostring(mino.lockTimer):sub(1, 4) .. " ")
term.setCursorPos(2, scr_y - 0)
term.clearLine()
term.write("Position: (" .. mino.x .. ":" .. mino.xFloat .. ", " .. mino.y .. "), Subheight: " .. mino.yFloat)
term.write("POS=(" .. mino.x .. ":" .. tostring(mino.xFloat):sub(1, 5) .. ", " .. mino.y .. ":" .. tostring(mino.yFloat):sub(1, 5) .. ") ")
end
@ -1045,8 +1046,14 @@ StartGame = function()
end
local TitleScreen = function()
StartGame()
end
term.clear()
StartGame()
TitleScreen()
term.setCursorPos(1, scr_y - 1)
term.clearLine()