diff --git a/rhythmblock.lua b/rhythmblock.lua index 4ffcf88..1181d28 100644 --- a/rhythmblock.lua +++ b/rhythmblock.lua @@ -2,9 +2,13 @@ accentColor = colors.gray buttonColor = colors.lightGray backgroundColor = colors.black +function round(n) + return n % 1 >= 0.5 and math.ceil(n) or math.floor(n) +end + width, height = term.getSize() -centerWidth = width / 2 -centerHeight = width / 2 +centerWidth = round(width / 2) +centerHeight = round(width / 2) peripherals = peripheral.getNames() playing = false if #peripherals < 0 then