345 lines
54 KiB
Lua
345 lines
54 KiB
Lua
--- @section MinigameDDRWindow
|
|
|
|
|
|
function MinigameDDRWindow.draw_background()
|
|
local img_values = {8,7,6,5,13,12,4,3,2,1,2,1,0,8,7,6,5,6,10,14,6,4,3,2,1,0,8,7,6,5,7,13,8,5,9,13,15,14,5,4,3,2,1,0,8,7,6,5,6,8,15,9,5,8,12,11,14,15,14,15,12,5,4,3,4,3,2,1,0,8,7,6,5,6,12,15,14,7,5,9,12,10,14,15,14,10,4,3,2,1,0,8,7,6,5,6,10,14,15,14,10,13,14,15,14,11,10,9,4,3,4,3,2,1,0,8,7,6,5,6,10,13,10,7,15,14,15,14,10,4,11,9,4,3,2,1,0,8,7,6,5,6,12,13,10,5,6,15,14,15,14,10,4,11,8,4,3,2,1,0,8,7,6,5,6,10,13,11,6,5,6,15,14,15,14,10,4,13,9,4,3,2,1,0,8,7,6,5,6,11,13,9,5,7,5,7,11,14,15,14,10,4,6,13,6,4,3,2,1,0,8,7,6,5,6,7,11,13,9,5,7,6,7,12,13,9,15,14,10,4,5,12,6,4,3,2,1,0,8,7,6,5,7,13,9,5,9,12,13,9,5,14,15,14,13,12,13,15,14,10,4,5,4,12,5,3,2,1,0,8,7,6,5,8,12,11,6,5,6,9,12,14,9,5,6,14,15,14,13,12,10,9,6,12,5,11,15,14,10,4,5,4,12,5,3,2,3,2,1,0,8,7,6,5,6,9,12,8,5,8,5,8,13,14,9,7,6,5,6,14,15,14,9,5,8,5,6,12,11,15,14,10,4,5,4,3,5,12,5,3,2,3,2,1,0,8,7,6,9,13,12,8,5,8,6,8,12,13,9,5,6,5,6,14,15,14,7,5,8,5,4,6,14,15,14,10,4,5,4,3,5,12,6,3,2,1,0,8,7,6,11,14,11,7,5,10,13,12,8,5,8,5,6,5,14,15,14,7,5,8,5,10,15,14,10,4,5,4,3,8,12,4,3,2,1,0,8,7,6,7,10,14,12,9,6,5,6,9,13,8,5,8,5,6,5,6,14,15,14,7,5,8,5,10,15,14,10,4,5,4,3,5,6,11,4,3,2,1,0,8,7,6,8,11,14,10,6,7,8,5,6,11,14,12,7,8,6,5,8,5,6,5,14,15,14,7,5,8,7,5,4,5,10,15,14,10,4,5,4,3,5,4,6,11,4,3,2,1,0,8,7,6,9,12,13,10,6,8,7,10,14,13,9,5,8,6,5,8,5,6,5,14,15,14,7,5,8,7,5,4,10,15,14,11,4,5,4,3,4,3,6,11,4,3,2,1,0,8,7,6,8,10,13,9,6,8,12,14,11,7,8,6,5,7,6,5,8,5,6,5,14,15,14,7,5,8,7,5,4,5,10,15,14,13,8,4,3,4,3,6,11,4,3,2,1,0,8,7,6,7,10,14,9,6,8,12,14,11,6,5,8,6,5,7,6,5,8,5,6,5,14,15,14,7,5,8,7,5,4,5,10,15,14,10,9,4,5,4,3,4,3,6,13,3,2,1,0,8,7,6,7,8,11,14,11,8,9,6,9,12,14,10,7,8,5,8,6,5,7,6,5,8,4,6,5,14,15,14,7,5,8,7,5,4,5,10,15,14,10,4,9,5,4,3,4,3,9,10,3,2,1,0,8,7,6,7,9,12,14,10,7,6,8,6,10,14,13,9,6,7,5,8,6,5,7,6,5,8,4,6,5,14,15,14,7,5,8,7,5,4,5,10,15,14,10,3,4,10,11,5,3,4,3,5,6,10,3,2,1,0,8,7,6,7,8,7,10,13,9,6,9,10,14,13,11,6,5,6,7,5,7,5,6,5,4,8,5,6,5,14,15,14,7,5,8,7,5,11,15,14,10,3,4,6,8,10,4,3,4,3,5,3,6,10,3,2,1,0,8,7,9,12,14,12,9,6,8,11,14,12,8,6,9,5,6,7,5,7,6,5,6,5,4,8,5,6,5,14,15,14,7,5,8,7,5,14,15,14,15,13,12,3,6,4,8,10,4,3,4,3,4,3,6,10,3,2,1,0,8,7,9,12,14,13,9,6,9,12,14,11,9,6,9,5,6,7,5,7,5,6,5,4,8,4,6,4,5,7,14,15,14,8,5,8,9,10,13,15,14,15,14,4,3,6,4,6,11,4,3,4,3,4,3,6,11,3,2,1,0,8,7,8,7,10,13,14,10,7,10,7,6,7,9,13,14,10,7,6,8,6,5,9,5,6,7,5,7,5,4,6,5,4,8,4,6,5,4,5,9,15,14,15,14,15,13,14,4,3,5,4,3,5,11,5,4,3,4,3,9,10,3,2,1,0,8,7,8,11,14,13,9,7,6,9,6,8,12,13,10,6,8,5,6,5,9,5,6,7,5,7,5,4,6,5,4,8,4,6,4,5,9,15,14,15,13,14,4,3,5,4,3,5,12,6,4,3,4,3,2,4,6,10,3,2,1,0,8,7,8,7,8,7,9,12,14,12,8,7,6,7,10,11,14,9,6,8,5,8,5,6,5,7,5,4,6,5,4,8,4,6,4,5,9,15,14,15,14,4,3,5,4,3,6,11,5,3,4,2,4,2,5,9,2,1,0,7,8,11,13,14,10,7,6,9,12,14,12,8,10,6,8,5,8,5,6,5,4,7,5,4,6,5,4,8,4,6,4,5,9,15,14,15,13,14,4,3,5,4,3,5,4,11,6,3,4,2,4,2,5,9,3,2,1,0,7,8,11,14,10,6,7,10,13,14,11,10,6,9,6,5,8,5,8,5,6,4,7,5,4,6,5,4,8,4,6,4,5,9,15,14,15,13,14,4,3,5,4,3,4,9,7,3,4,2,4,2,6,11,2,1,0,7,9,12,14,11,8,10,7,6,7,11,14,13,10,6,9,6,9,6,5,8,5,8,5,6,4,7,5,4,6,5,4,7,4,5,6,4,5,9,15,14,15,13,14,4,3,5,4,3,4,3,9,3,4,3,2,4,2,8,10,2,1,0,7,6,7,10,13,10,7,6,9,7,8,12,14,12,8,6,9,6,5,9,5,8,5,8,5,6,4,7,5,4,6,5,4,7,4,5,6,4,5,9,15,14,13,15,14,15,13,14,4,3,5,4,5,3,5,4,3,9,4,3,2,4,2,4,10,2,1,0,7,6,7,8,12,14,12,9,6,9,11,14,11,7,6,5,9,5,9,5,8,5,8,5,4,5,6,4,6,5,4,5,4,7,4,5,6,4,9,15,14,13,10,7,9,7,4,14,15,14,15,13,14,4,3,5,4,5,3,5,4,3,4,5,10,3,2,4,2,4,2,4,10,2,1,0,6,7,8,10,13,14,11,7,6,7,10,14,13,7,6,5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,7,6,5,6,9,10,9,10,9,10,6,5,6,9,8,10,9,7,8,5,3,8,9,3,6,7,9,5,7,8,10,8,9,5,6,5,8,7,6,5,6,5,6,5,4,5,8,7,8,11,10,9,8,13,14,13,9,6,7,9,8,4,6,14,13,14,13,11,4,6,8,9,8,9,8,9,10,11,12,13,12,11,10,8,6,9,5,7,9,6,7,9,8,9,8,7,10,9,11,9,10,9,10,11,10,12,13,12,11,10,12,13,12,13,12,11,12,13,12,13,12,13,12,11,10,11,10,11,6,8,7,6,7,6,8,9,7,9,10,8,9,7,5,7,8,2,12,9,7,6,5,4,9,5,7,8,9,6,5,9,8,7,6,8,6,4,6,8,6,5,8,6,9,10,7,10,8,9,3,11,14,13,12,3,8,6,10,14,13,14,13,12,10,8,10,7,11,10,12,10,12,13,14,13,12,11,10,11,10,9,10,11,10,8,9,10,11,10,11,10,12,11,12,13,14,13,14,13,12,13,12,13,12,8,12,6,9,10,9,10,11,12,9,10,9,8,9,10,9,11,5,4,9,8,6,3,6,5,6,9,2,5,6,7,6,5,6,8,10,8,9,10,6,4,9,8,6,8,9,10,9,8,11,10,8,7,11,13,14,13,11,9,11,10,9,10,13,14,13,12,8,9,10,11,9,11,10,11,12,13,14,13,14,13,12,13,12,11,12,11,13,12,11,13,14,13,14,13,12,13,12,13,12,13,12,13,12,13,12,11,7,8,11,6,8,9,10,11,13,12,13,11,7,5,6,8,9,7,8,6,4,7,4,6,8,5,6,4,5,8,5,4,7,9,5,6,7,8,6,7,6,9,8,9,8,9,7,8,10,7,10,7,8,6,12,13,14,13,11,10,11,13,14,13,12,11,10,9,12,13,11,13,14,13,14,13,14,13,12,13,14,13,14,13,14,13,14,13,14,13,10,12,13,12,13,12,10,12,13,12,11,9,11,9,10,8,9,13,14,11,10,13,12,13,12,13,12,13,10,9,5,8,10,9,12,8,6,9,11,6,7,9,7,10,9,10,8,5,4,3,4,8,6,5,6,5,10,5,7,8,6,12,14,13,9,6,8,7,9,8,7,13,14,13,12,11,9,10,13,12,11,12,11,12,11,10,9,10,11,13,14,13,14,13,14,13,14,13,14,13,14,13,14,13,14,13,12,13,11,7,12,10,12,13,12,13,12,13,12,13,12,13,12,10,11,12,11,12,10,12,10,9,8,10,8,9,8,9,5,4,6,4,5,8,9,12,9,10,12,9,6,10,8,6,8,6,8,5,8,5,6,8,7,8,5,3,8,6,4,5,7,6,4,7,6,4,7,5,6,9,6,12,13,14,13,9,8,10,12,13,14,13,12,14,13,6,4,8,10,8,10,8,11,9,7,10,9,12,13,12,14,12,13,10,9,11,10,11,8,9,12,13,14,9,10,13,14,13,14,13,14,13,14,13,14,13,14,13,12,13,12,13,12,13,12,13,12,13,12,11,12,13,12,9,10,12,9,10,9,10,9,10,9,10,9,10,9,10,12,10,11,12,7,9,10,11,12,11,9,7,8,9,8,10,9,8,7,5,8,7,11,12,11,8,9,6,9,8,13,14,13,14,13,12,11,12,13,14,13,12,8,12,11,10,11,10,13,12,13,12,9,12,10,11,13,11,13,12,13,11,10,11,12,13,11,12,14,13,12,9,12,13,14,13,14,13,14,13,14,13,14,13,14,13,14,12,14,12,13,14,12,11,7,10,11,8,10,7,9,10,11,10,11,12,11,12,11,12,9,12,9,10,9,11,9,10,9,11,9,8,9,11,10,9,10,9,10,9,10,9,10,9,10,9,10,8,12,13,14,13,12,11,12,13,14,13,12,13,12,9,12,14,13,11,10,12,13,14,13,14,13,12,10,9,6,7,8,4,6,10,13,7,11,13,14,13,14,13,14,13,12,13,14,13,12,13,11,12,11,10,14,13,14,12,14,13,12,11,13,12,9,3,4,5,4,9,6,2,3,6,9,5,6,3,8,12,11,12,11,12,11,12,10,11,12,9,12,9,10,9,11,9,10,9,10,8,10,8,9,8,9,8,9,8,7,8,9,8,9,7,8,9,7,8,12,14,10,8,9,10,13,14,13,12,11,9,10,9,10,9,10,11,10,9,10,11,10,11,12,11,10,11,12,11,12,11,12,10,11,10,8,10,9,13,11,10,11,10,12,11,13,14,13,11,12,13,14,13,14,13,12,11,6,0,7,10,8,4,1,0,1,3,0,1,2,9,10,12,11,12,11,12,11,12,9,10,12,9,10,11,9,10,9,10,9,10,9,10,8,9,8,9,8,9,8,9,7,8,7,8,13,14,15,14,10,8,9,8,10,14,13,14,13,12,8,9,8,9,7,9,7,8,7,9,7,9,7,8,7,9,7,9,7,9,8,7,9,8,6,9,6,7,9,7,8,9,8,9,10,9,10,11,12,11,12,10,12,11,12,13,14,13,14,13,12,13,12,13,9,12,10,8,5,2,1,0,1,2,3,6,10,12,11,10,11,12,9,11,10,12,11,12,11,9,12,9,10,9,10,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,7,9,7,8,7,12,13,14,9,7,9,8,7,9,13,14,13,11,8,9,10,8,9,8,9,10,8,6,8,6,8,6,8,6,8,7,6,8,5,6,8,5,6,5,6,5,6,7,6,5,7,9,10,9,11,10,11,12,13,12,13,12,13,14,13,11,12,9,13,10,12,11,9,5,1,0,1,4,7,10,11,12,13,11,12,11,9,11,10,12,13,12,11,9,12,9,8,9,10,8,9,8,7,9,7,9,7,8,9,7,9,7,8,7,8,9,7,9,7,8,7,12,14,10,7,9,8,9,8,9,13,14,13,12,11,7,8,9,7,8,7,8,7,9,7,9,7,9,8,9,7,9,7,9,8,6,8,7,6,8,6,5,7,5,6,5,4,5,6,4,5,6,5,4,6,4,7,5,6,5,7,5,9,8,7,6,9,11,12,13,9,12,13,12,14,13,14,13,14,9,13,11,10,12,9,7,2,1,4,8,10,11,12,13,12,13,12,13,14,13,11,12,14,10,9,12,9,11,12,11,12,8,9,11,8,10,9,10,8,9,8,9,8,10,8,9,7,8,7,9,7,8,6,7,8,6,9,6,8,7,8,14,15,14,13,9,8,10,14,13,14,13,12,11,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,10,8,7,9,6,4,5,6,5,6,5,7,5,6,5,8,6,10,11,9,10,11,12,11,12,13,14,13,9,13,10,12,10,5,1,0,1,3,9,10,11,12,13,14,13,12,13,14,13,14,13,14,10,11,13,10,8,12,2,5,12,13,12,11,10,9,8,9,11,8,7,8,9,10,8,9,8,9,8,7,9,7,9,7,9,7,8,7,8,9,7,9,7,8,9,13,14,13,14,13,14,13,12,9,10,9,10,9,10,9,8,9,10,9,10,9,10,9,10,9,10,9,10,9,10,9,10,9,10,8,9,6,8,6,5,7,5,8,6,7,5,7,5,6,5,6,5,6,5,7,6,7,8,9,11,10,6,10,11,10,9,7,3,1,0,1,5,9,10,11,12,13,14,13,14,13,10,11,13,10,8,12,2,4,10,12,13,12,10,9,8,6,5,3,1,8,9,11,8,7,8,9,10,7,6,8,7,6,9,7,6,7,9,7,9,7,9,7,9,8,7,8,9,8,9,7,8,7,9,13,14,12,14,13,12,9,8,9,10,9,8,9,10,9,10,8,9,7,8,6,8,7,6,8,6,7,9,6,8,7,8,7,8,6,8,7,5,7,5,6,5,7,4,5,6,4,6,5,6,5,6,7,3,7,8,7,8,3,1,0,1,4,9,10,11,12,10,14,12,11,12,10,7,5,9,12,14,12,13,14,13,14,13,11,14,10,7,6,3,7,9,10,11,12,11,10,11,12,11,7,8,3,2,8,9,11,8,7,8,7,9,8,10,7,6,7,6,8,6,9,6,9,6,8,6,8,6,8,7,6,7,8,6,9,6,7,6,8,13,14,12,14,13,12,8,7,8,6,8,7,8,6,7,8,6,9,7,8,6,8,6,9,7,8,6,8,6,5,8,5,4,5,7,4,5,6,4,6,5,6,5,4,6,5,4,6,4,5,4,6,4,5,4,5,4,5,4,5,2,5,6,8,3,1,0,1,4,9,10,11,12,13,14,12,11,8,7,9,8,9,7,0,1,6,13,14,13,14,13,14,12,13,11,10,8,4,3,4,3,2,8,9,11,8,9,10,8,7,9,7,9,7,6,9,6,9,6,7,6,8,6,7,6,8,6,8,7,9,7,8,7,9,13,14,12,14,13,12,9,8,7,8,6,7,6,8,6,8,6,7,8,6,8,6,8,6,9,8,9,7,8,7,6,8,7,6,8,6,7,8,9,7,8,7,8,6,8,7,6,5,8,6,5,6,4,6,4,5,2,3,5,4,5,4,6,4,1,0,1,3,8,10,11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,14,13,12,13,12,9,6,4,3,2,9,12,9,8,9,10,8,9,8,9,8,7,8,9,7,9,7,9,7,8,6,7,9,7,8,7,9,13,14,13,14,13,14,12,14,13,12,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,7,9,7,8,7,8,6,8,7,8,6,5,6,7,9,8,9,5,1,0,1,2,6,9,11,12,13,12,14,12,9,6,5,4,3,2,3,4,11,12,11,13,10,11,9,6,5,4,3,2,3,9,12,9,8,9,10,8,9,8,9,8,9,8,7,8,7,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,10,13,14,13,12,9,10,11,12,14,13,12,11,9,10,9,10,9,10,9,10,9,8,9,8,9,8,9,8,9,8,9,7,8,9,7,8,9,7,8,3,6,8,7,9,8,9,10,5,1,0,3,6,9,10,12,13,14,12,10,7,6,5,4,3,2,3,9,10,9,10,12,13,7,8,7,5,4,3,2,9,11,9,10,9,10,8,9,8,9,8,7,9,7,9,7,9,8,7,8,9,8,9,8,9,10,9,10,13,14,13,12,9,10,9,12,14,13,12,11,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,7,9,7,6,9,7,8,7,8,7,3,5,8,7,6,8,10,9,3,2,0,1,3,7,9,11,12,13,14,12,10,7,6,5,4,5,4,3,2,3,4,5,9,10,9,10,12,6,5,6,4,3,2,9,11,9,10,9,10,8,9,8,7,9,8,7,8,9,8,9,8,9,8,9,8,9,10,9,10,9,10,13,14,13,12,9,11,12,14,13,12,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,7,9,7,6,4,9,7,8,7,8,7,9,10,6,2,0,1,2,6,9,10,11,13,14,9,11,14,13,10,7,5,4,3,4,3,2,3,4,5,9,10,9,10,12,11,6,4,5,4,3,2,9,10,12,9,10,9,10,8,9,8,7,9,7,8,9,8,9,8,9,8,9,10,9,10,9,10,11,10,11,13,14,13,12,9,10,9,11,13,12,14,13,12,11,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,8,7,9,7,8,9,8,7,9,6,5,1,7,6,7,8,6,9,6,5,3,1,0,1,3,8,9,10,12,13,12,13,12,15,10,12,14,13,10,8,6,5,4,3,4,3,2,3,4,7,10,6,3,4,3,2,9,10,12,9,10,9,10,9,8,9,8,9,8,9,8,7,8,9,8,10,9,10,11,10,9,10,9,10,11,13,14,13,12,11,9,11,13,12,14,13,12,9,8,9,8,9,8,7,9,8,9,8,9,8,7,9,7,8,7,9,8,7,9,8,7,9,7,6,5,8,7,8,10,11,9,4,1,0,1,2,6,9,10,12,13,12,13,14,15,14,15,9,12,14,11,8,6,5,4,3,4,5,7,9,10,9,6,3,4,3,2,9,10,12,9,8,10,9,10,8,9,10,9,10,9,10,11,10,11,10,11,10,9,10,13,14,13,12,11,9,8,11,13,12,14,13,11,9,8,9,7,9,7,8,7,9,8,9,8,9,8,7,9,7,8,7,6,8,7,9,8,7,9,7,8,10,8,3,1,0,2,4,6,9,10,12,13,12,13,14,15,14,15,9,7,6,5,4,3,2,3,4,5,7,9,10,9,7,3,4,3,2,9,10,12,9,10,9,10,9,10,9,10,11,10,11,10,11,10,9,10,13,14,13,12,11,9,11,13,12,14,13,11,9,8,9,8,9,8,9,8,9,8,9,8,9,8,9,7,6,2,7,8,9,8,9,10,6,9,3,2,1,0,1,4,6,9,10,11,12,13,12,13,14,11,10,14,10,8,7,6,5,4,3,4,6,8,9,6,4,3,2,10,9,10,12,9,10,11,12,10,11,10,11,10,11,10,11,10,9,10,9,10,9,10,12,13,14,13,12,11,8,9,11,13,12,14,13,11,9,8,9,8,9,8,9,8,9,10,9,10,9,8,9,8,11,8,4,1,0,2,4,7,10,11,12,13,14,15,14,12,9,10,9,7,6,5,4,3,4,6,8,9,8,9,8,6,4,3,2,1,10,12,10,11,12,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,12,14,13,12,11,9,10,9,11,13,12,14,13,11,10,9,10,9,8,9,10,9,10,9,10,9,10,8,3,1,3,6,8,10,11,12,13,12,14,13,14,12,9,8,7,6,5,4,5,6,7,8,9,8,9,8,6,5,4,3,2,10,12,10,9,10,11,9,10,11,10,11,12,11,10,11,10,11,10,11,10,11,10,12,14,13,14,12,11,10,9,11,13,12,14,13,11,9,10,9,10,9,10,9,8,10,9,10,9,10,8,4,3,1,2,1,4,7,10,11,12,13,14,13,10,8,6,7,8,7,6,5,6,7,8,7,8,9,8,6,5,4,3,2,1,10,12,10,11,10,11,9,10,9,11,10,11,10,11,10,11,10,11,10,11,10,11,12,13,14,12,11,10,12,13,12,14,13,11,10,9,10,9,8,10,9,10,9,10,12,11,9,4,2,1,2,5,9,10,11,12,13,14,13,14,15,13,11,10,9,8,7,6,7,8,7,6,7,6,5,6,7,8,9,8,7,6,5,4,3,2,10,12,10,9,10,11,10,9,10,11,10,11,10,11,10,11,10,11,10,11,12,13,14,12,11,10,11,12,14,13,11,10,9,10,9,10,9,10,9,12,11,8,7,2,3,1,3,6,9,10,11,12,13,14,13,14,15,14,11,10,9,8,7,6,5,6,8,9,8,6,7,8,7,6,4,3,2,10,11,12,10,11,10,11,12,11,12,11,12,11,12,11,10,11,10,11,12,14,13,14,12,10,11,12,14,13,11,10,9,10,9,10,12,11,7,4,2,1,3,6,10,12,14,12,13,14,13,15,14,13,14,12,11,9,8,7,6,5,4,5,4,5,6,7,8,6,7,8,9,8,6,5,4,3,2,1,10,11,12,10,11,12,11,12,11,12,11,10,11,10,11,10,11,10,11,12,11,10,11,12,14,13,14,12,10,11,13,12,14,13,11,10,9,11,12,10,8,5,3,2,3,7,10,13,14,13,14,15,14,13,11,9,8,9,8,7,6,7,6,7,6,5,4,5,6,7,6,5,4,5,6,7,8,7,6,4,3,2,10,11,12,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,12,13,14,13,12,10,9,10,12,11,14,13,11,10,11,12,11,8,6,1,0,1,4,9,11,12,13,14,13,14,13,14,15,14,13,11,9,8,7,8,7,6,5,4,5,6,5,4,5,6,7,8,6,5,4,3,2,11,12,11,10,11,12,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,10,11,12,13,14,13,12,10,9,5,4,12,11,14,13,11,12,7,6,2,3,2,0,1,10,12,13,14,13,14,15,13,12,10,9,8,7,8,7,6,5,4,3,4,5,6,5,4,5,6,7,6,5,3,2,1,11,12,11,12,11,10,11,10,12,11,10,11,10,11,10,11,10,9,10,11,10,11,12,13,14,13,12,10,4,3,12,11,14,12,13,11,10,8,7,5,2,3,7,10,11,9,3,6,11,13,14,13,14,15,14,12,11,10,9,8,9,8,9,8,7,6,5,4,5,6,5,4,5,6,7,6,4,3,2,1,2,1,11,13,11,12,11,12,11,10,11,12,11,10,11,10,11,10,11,10,9,10,13,12,13,14,13,12,10,9,11,12,11,14,12,13,11,4,2,4,0,1,10,11,12,14,13,14,13,11,9,10,9,8,9,8,7,6,7,6,5,6,7,6,5,6,7,8,7,6,4,3,2,1,2,1,11,12,13,11,12,11,12,11,12,11,12,11,12,11,10,9,6,8,6,13,12,13,14,13,11,10,11,12,11,14,12,13,10,6,8,10,8,10,11,13,14,13,12,13,14,13,12,11,10,9,10,9,8,9,8,7,8,7,6,7,6,7,6,5,6,7,8,7,6,4,3,2,1,11,12,13,12,11,12,11,12,11,12,11,12,11,12,11,12,11,10,11,10,9,5,8,9,8,2,9,12,14,12,13,14,13,14,11,12,10,6,11,13,11,14,12,10,11,10,1,11,12,13,14,13,12,13,15,14,15,14,13,11,10,11,10,9,10,9,8,7,8,9,8,7,6,7,8,7,6,7,8,6,5,4,3,2,1,12,13,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,10,11,10,6,1,4,9,10,11,12,14,13,14,13,12,14,12,10,8,5,4,11,14,11,14,12,10,9,5,9,12,13,12,15,14,15,14,15,14,13,12,10,9,10,11,10,9,10,9,8,7,8,9,8,7,6,7,8,7,6,5,4,3,2,1,12,13,12,11,12,11,12,11,12,11,8,1,9,11,13,14,13,14,13,3,10,9,6,4,6,8,12,13,11,13,6,12,9,8,12,13,14,13,14,15,14,12,11,10,11,10,9,10,9,10,9,8,7,6,5,6,7,6,5,4,3,2,1,12,13,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,12,11,10,9,11,12,14,13,12,11,9,4,6,4,8,10,12,13,12,11,14,11,13,12,13,11,14,15,14,12,11,10,11,10,11,10,11,10,9,10,9,8,7,8,7,6,5,4,3,2,1,12,13,12,11,12,11,12,11,12,11,12,11,12,11,12,11,10,11,10,8,7,5,4,6,0,2,12,13,14,13,12,14,13,14,15,14,12,11,12,11,12,11,12,11,10,11,10,9,10,9,10,9,10,9,10,9,8,7,8,7,8,7,6,5,4,3,2,1,12,13,12,11,12,11,12,11,12,11,12,11,12,11,9,11,12,11,10,9,7,6,5,3,4,5,8,10,11,10,8,11,12,13,14,13,14,13,14,12,11,12,11,12,11,10,9,10,9,10,11,10,9,10,9,8,7,8,7,6,5,4,3,2,12,13,12,11,12,13,12,11,12,11,12,11,12,11,9,8,4,2,3,2,4,7,10,11,10,11,12,13,14,15,14,15,14,11,13,3,7,12,11,10,11,10,11,12,11,10,9,7,6,8,9,10,11,10,9,8,7,8,7,6,5,6,5,4,3,2,12,13,11,12,11,12,13,12,11,12,13,12,11,12,11,12,11,13,11,10,9,8,6,4,3,4,3,5,4,1,10,12,13,12,13,14,13,14,15,14,15,14,15,13,14,11,12,7,1,6,9,10,11,10,9,8,9,10,11,10,9,8,9,8,7,6,5,4,3,2,12,11,12,13,11,12,11,12,11,12,13,12,11,3,9,11,12,11,12,11,12,13,12,11,9,8,6,3,5,9,10,11,12,13,14,13,15,13,15,14,12,14,12,10,9,8,9,10,9,10,11,10,9,8,9,8,9,8,9,10,11,10,9,8,9,8,7,6,5,4,3,12,13,12,11,12,11,12,11,12,11,10,9,10,11,10,11,12,11,12,13,11,10,8,4,6,8,10,11,10,11,12,13,12,13,14,15,14,12,14,15,12,15,14,12,14,13,11,10,11,10,11,10,9,8,9,10,11,10,9,8,9,10,9,8,7,6,5,4,3,4,11,13,11,12,11,12,11,12,13,12,13,14,13,12,14,12,11,12,13,12,8,4,10,9,7,5,6,5,6,7,9,11,10,12,13,14,13,14,12,14,15,14,15,13,14,15,12,15,14,12,13,11,10,11,10,11,10,9,10,11,10,9,8,9,10,9,8,7,6,5,4,3,11,13,11,12,11,12,11,12,13,14,15,14,15,14,12,14,15,14,13,12,11,10,6,3,9,6,4,6,8,10,13,12,11,12,13,14,13,14,13,14,13,14,15,14,15,14,15,12,15,14,12,11,13,11,10,11,10,11,10,11,10,9,10,11,10,9,8,9,8,7,6,5,4,3,11,12,13,11,12,11,12,11,12,13,14,15,14,15,14,15,12,13,14,13,12,10,8,11,12,13,12,14,13,12,14,13,14,15,14,15,12,14,13,14,11,13,11,10,11,10,9,8,7,6,5,4,11,12,13,11,12,11,12,14,15,14,13,14,13,14,13,14,15,11,1,10,15,14,13,14,13,15,14,15,12,14,13,14,11,13,11,10,11,10,11,10,9,8,7,6,5,4,3,13,12,13,11,12,11,12,11,12,13,15,14,15,14,15,14,15,14,15,14,15,14,15,14,15,14,13,14,9,8,14,15,14,12,13,14,15,13,15,12,14,13,14,11,13,12,11,10,11,10,9,8,7,6,5,4,3,14,13,12,13,15,14,15,14,15,14,15,14,13,14,15,14,13,15,14,13,14,15,14,13,15,12,14,13,14,11,12,13,12,11,12,11,10,11,10,9,8,7,6,5,4,15,14,13,12,13,14,15,14,13,14,15,14,15,14,13,15,12,14,13,14,11,12,11,12,11,12,11,12,11,12,11,12,11,10,9,8,7,6,7,6,5,4,14,15,14,12,13,14,15,14,15,14,15,14,13,14,15,14,15,13,14,15,12,14,13,14,11,12,11,12,11,12,11,12,11,12,11,10,9,8,7,6,7,6,7,6,5,14,12,13,14,15,14,15,14,15,14,13,14,15,14,15,14,12,14,12,14,13,14,12,11,12,11,10,9,8,7,6,7,6,14,15,14,13,12,13,14,13,14,15,14,15,14,15,14,15,13,12,13,14,15,12,14,13,14,12,11,12,13,12,13,12,13,12,13,12,13,12,11,12,11,10,9,10,9,8,7,6,14,13,12,14,15,14,15,14,15,14,13,14,12,14,13,14,12,13,12,11,10,9,10,9,8,7,6,7,6,14,15,14,12,14,15,14,15,14,15,14,15,14,12,14,13,14,12,11,13,12,13,12,13,12,11,10,9,8,7,6,14,15,14,15,14,15,14,12,14,13,14,12,13,12,13,12,11,10,9,8,7,8,7,6,14,15,14,15,14,12,14,13,14,12,13,12,13,12,13,12,11,10,9,8,7,6,14,13,14,15,14,15,14,13,14,12,14,13,14,12,13,12,13,12,13,12,13,12,13,12,11,10,11,10,11,10,9,8,7,15,14,13,14,15,14,15,14,12,15,13,14,12,13,12,13,12,11,10,11,10,9,8,7,14,15,14,15,14,15,14,13,14,13,14,12,14,13,14,12,13,14,13,14,13,12,11,10,9,8,15,14,15,14,13,14,13,14,13,12,13,14,13,12,11,10,9,8,15,14,15,14,15,14,15,14,13,14,13,14,13,12,11,10,9,8,15,14,15,14,15,14,15,14,15,14,13,14,13,14,13,14,13,14,13,14,13,14,13,14,13,12,11,10,9,8,15,14,15,14,15,14,15,14,13,14,13,12,13,12,11,10,9,15,14,15,14,15,14,15,13,14,15,14,13,14,13,14,13,12,11,10,9,15,14,15,14,15,14,15,14,13,12,11,10,9,15,14,15,14,13,15,14,13,14,13,12,11,10,9}
|
|
local img_runs = {11,13,20,42,1,1,16,32,37,2,2,49,14,11,12,20,41,1,1,2,1,14,32,39,50,16,11,12,20,29,1,1,1,8,1,1,3,1,1,13,32,38,47,20,11,12,20,28,1,1,1,1,6,1,1,1,1,1,1,2,1,1,9,1,2,32,36,49,20,12,12,19,26,2,1,2,1,1,3,1,2,1,1,2,4,1,9,32,37,48,23,11,12,20,25,1,1,1,4,1,2,1,2,5,3,1,1,1,5,1,2,32,36,47,25,12,11,21,22,1,1,1,1,1,5,2,8,3,1,1,1,1,6,27,37,49,28,12,12,20,20,1,1,1,1,1,2,3,2,10,3,1,2,1,1,5,27,37,47,30,12,13,19,18,1,1,1,1,1,3,1,1,2,12,3,1,3,1,1,2,26,39,46,32,13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,62,2,5,1,4,1,4,3,2,32,1,14,2,7,1,2,1,1,4,1,2,7,1,1,25,23,8,10,10,3,69,1,9,1,1,2,2,7,1,71,30,1,2,12,9,12,10,64,1,12,1,2,3,1,1,1,4,3,1,70,1,1,25,21,8,11,9,79,1,2,1,1,3,5,78,23,19,10,10,8,80,1,5,2,1,2,80,2,2,20,19,12,10,4}
|
|
-- local pal = {226,226,226,210,210,210,198,198,198,189,189,189,182,182,182,176,176,176,170,170,170,165,165,165,161,161,161,153,153,153,143,143,143,134,134,134,124,124,124,111,111,111,97,97,97,52,52,52}
|
|
RLE.draw(img_values, img_runs)
|
|
end
|
|
|
|
--- Gets initial DDR minigame configuration.
|
|
--- @within MinigameDDRWindow
|
|
--- @return result table The default DDR minigame configuration.
|
|
function MinigameDDRWindow.init_context()
|
|
local arrow_size = 12
|
|
local arrow_spacing = 30
|
|
local total_width = (4 * arrow_size) + (3 * arrow_spacing)
|
|
local start_x = (Config.screen.width - total_width) / 2
|
|
return {
|
|
bar_fill = 0,
|
|
max_fill = 100,
|
|
fill_per_hit = 10,
|
|
miss_penalty = 5,
|
|
bar_x = 20,
|
|
bar_y = 10,
|
|
bar_width = 200,
|
|
bar_height = 12,
|
|
arrow_size = arrow_size,
|
|
arrow_spawn_timer = 0,
|
|
arrow_spawn_interval = 45,
|
|
arrow_fall_speed = 1.5,
|
|
arrows = {},
|
|
target_y = 115,
|
|
target_arrows = {
|
|
{ dir = "left", x = start_x },
|
|
{ dir = "down", x = start_x + arrow_size + arrow_spacing },
|
|
{ dir = "up", x = start_x + (arrow_size + arrow_spacing) * 2 },
|
|
{ dir = "right", x = start_x + (arrow_size + arrow_spacing) * 3 }
|
|
},
|
|
hit_threshold = 8,
|
|
button_pressed_timers = {},
|
|
button_press_duration = 8,
|
|
input_cooldowns = { left = 0, down = 0, up = 0, right = 0 },
|
|
input_cooldown_duration = 10,
|
|
frame_counter = 0,
|
|
current_song = nil,
|
|
pattern_index = 1,
|
|
use_pattern = false,
|
|
return_window = nil,
|
|
win_timer = 0,
|
|
on_win = nil,
|
|
special_condition_met = false,
|
|
total_misses = 0,
|
|
}
|
|
end
|
|
|
|
--- Initializes DDR minigame state.
|
|
--- @within MinigameDDRWindow
|
|
--- @param params table Optional parameters for configuration.<br/>
|
|
function MinigameDDRWindow.init(params)
|
|
local defaults = MinigameDDRWindow.init_context()
|
|
if params then
|
|
for k, v in pairs(params) do
|
|
defaults[k] = v
|
|
end
|
|
end
|
|
Context.minigame_ddr = defaults
|
|
end
|
|
|
|
--- Starts the DDR minigame.
|
|
--- @within MinigameDDRWindow
|
|
--- @param return_window string The window ID to return to after the minigame.</br>
|
|
--- @param[opt] song_key string The key of the song to play.</br>
|
|
--- @param[opt] params table Optional parameters for minigame configuration.</br>
|
|
function MinigameDDRWindow.start(return_window, song_key, params)
|
|
MinigameDDRWindow.init(params)
|
|
Context.minigame_ddr.return_window = return_window or "game"
|
|
Context.minigame_ddr.debug_song_key = song_key
|
|
if song_key and Songs and Songs[song_key] then
|
|
Context.minigame_ddr.current_song = Songs[song_key]
|
|
Context.minigame_ddr.use_pattern = true
|
|
Context.minigame_ddr.pattern_index = 1
|
|
Context.minigame_ddr.debug_status = "Pattern loaded: " .. song_key
|
|
else
|
|
Context.minigame_ddr.use_pattern = false
|
|
if song_key then
|
|
Context.minigame_ddr.debug_status = "Song not found: " .. tostring(song_key)
|
|
else
|
|
Context.minigame_ddr.debug_status = "Random mode"
|
|
end
|
|
end
|
|
Window.set_current("minigame_ddr")
|
|
end
|
|
|
|
--- Spawns a random arrow.
|
|
--- @within MinigameDDRWindow
|
|
local function spawn_arrow()
|
|
local mg = Context.minigame_ddr
|
|
local target = mg.target_arrows[math.random(1, 4)]
|
|
table.insert(mg.arrows, {
|
|
dir = target.dir,
|
|
x = target.x,
|
|
y = mg.bar_y + mg.bar_height + 10
|
|
})
|
|
end
|
|
|
|
--- Spawns an arrow in a specific direction.
|
|
--- @within MinigameDDRWindow
|
|
--- @param direction string The direction of the arrow ("left", "down", "up", "right").
|
|
local function spawn_arrow_dir(direction)
|
|
local mg = Context.minigame_ddr
|
|
for _, target in ipairs(mg.target_arrows) do
|
|
if target.dir == direction then
|
|
table.insert(mg.arrows, {
|
|
dir = direction,
|
|
x = target.x,
|
|
y = mg.bar_y + mg.bar_height + 10
|
|
})
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
--- Checks if an arrow is hit.
|
|
--- @within MinigameDDRWindow
|
|
--- @param arrow table The arrow data.
|
|
--- @return boolean True if the arrow is hit, false otherwise.
|
|
local function check_hit(arrow)
|
|
local mg = Context.minigame_ddr
|
|
local distance = math.abs(arrow.y - mg.target_y)
|
|
return distance <= mg.hit_threshold
|
|
end
|
|
|
|
--- Checks if an arrow is missed.
|
|
--- @within MinigameDDRWindow
|
|
--- @param arrow table The arrow data.
|
|
--- @return boolean True if the arrow is missed, false otherwise.
|
|
local function check_miss(arrow)
|
|
local mg = Context.minigame_ddr
|
|
return arrow.y > mg.target_y + mg.hit_threshold
|
|
end
|
|
|
|
--- Draws an arrow.
|
|
--- @within MinigameDDRWindow
|
|
--- @param x number The x-coordinate.
|
|
--- @param y number The y-coordinate.
|
|
--- @param direction string The direction of the arrow.
|
|
--- @param color number The color of the arrow.
|
|
local function draw_arrow(x, y, direction, color)
|
|
local size = 12
|
|
local half = size / 2
|
|
if direction == "left" then
|
|
tri(x + half, y, x, y + half, x + half, y + size, color)
|
|
rectb(x + half, y + half - 2, half, 4, color)
|
|
elseif direction == "right" then
|
|
tri(x + half, y, x + size, y + half, x + half, y + size, color)
|
|
rectb(x, y + half - 2, half, 4, color)
|
|
elseif direction == "up" then
|
|
tri(x, y + half, x + half, y, x + size, y + half, color)
|
|
rectb(x + half - 2, y + half, 4, half, color)
|
|
elseif direction == "down" then
|
|
tri(x, y + half, x + half, y + size, x + size, y + half, color)
|
|
rectb(x + half - 2, y, 4, half, color)
|
|
end
|
|
end
|
|
|
|
--- Updates DDR minigame logic.
|
|
--- @within MinigameDDRWindow
|
|
function MinigameDDRWindow.update()
|
|
local mg = Context.minigame_ddr
|
|
|
|
if mg.win_timer > 0 then
|
|
mg.win_timer = mg.win_timer - 1
|
|
if mg.win_timer == 0 then
|
|
mg.special_condition_met = (mg.total_misses == 0)
|
|
Meter.on_minigame_complete()
|
|
if mg.on_win then
|
|
mg.on_win()
|
|
else
|
|
Meter.show()
|
|
Window.set_current(mg.return_window)
|
|
end
|
|
end
|
|
return
|
|
end
|
|
|
|
if mg.bar_fill >= mg.max_fill then
|
|
mg.win_timer = Config.timing.minigame_win_duration
|
|
return
|
|
end
|
|
mg.frame_counter = mg.frame_counter + 1
|
|
if mg.use_pattern and mg.current_song and mg.current_song.end_frame then
|
|
if mg.frame_counter > mg.current_song.end_frame and #mg.arrows == 0 then
|
|
mg.win_timer = Config.timing.minigame_win_duration
|
|
return
|
|
end
|
|
end
|
|
if mg.use_pattern and mg.current_song and mg.current_song.pattern then
|
|
local pattern = mg.current_song.pattern
|
|
while mg.pattern_index <= #pattern do
|
|
local spawn_entry = pattern[mg.pattern_index]
|
|
if mg.frame_counter >= spawn_entry.frame then
|
|
spawn_arrow_dir(spawn_entry.dir)
|
|
mg.pattern_index = mg.pattern_index + 1
|
|
else
|
|
break
|
|
end
|
|
end
|
|
else
|
|
mg.arrow_spawn_timer = mg.arrow_spawn_timer + 1
|
|
if mg.arrow_spawn_timer >= mg.arrow_spawn_interval then
|
|
spawn_arrow()
|
|
mg.arrow_spawn_timer = 0
|
|
end
|
|
end
|
|
local arrows_to_remove = {}
|
|
for i, arrow in ipairs(mg.arrows) do
|
|
arrow.y = arrow.y + mg.arrow_fall_speed
|
|
if check_miss(arrow) then
|
|
table.insert(arrows_to_remove, i)
|
|
mg.bar_fill = mg.bar_fill - mg.miss_penalty
|
|
if mg.bar_fill < 0 then
|
|
mg.bar_fill = 0
|
|
end
|
|
mg.total_misses = mg.total_misses + 1
|
|
end
|
|
end
|
|
-- iterate backwards to avoid index shift issues
|
|
for i = #arrows_to_remove, 1, -1 do
|
|
table.remove(mg.arrows, arrows_to_remove[i])
|
|
end
|
|
for dir, _ in pairs(mg.input_cooldowns) do
|
|
if mg.input_cooldowns[dir] > 0 then
|
|
mg.input_cooldowns[dir] = mg.input_cooldowns[dir] - 1
|
|
end
|
|
end
|
|
for dir, _ in pairs(mg.button_pressed_timers) do
|
|
if mg.button_pressed_timers[dir] > 0 then
|
|
mg.button_pressed_timers[dir] = mg.button_pressed_timers[dir] - 1
|
|
end
|
|
end
|
|
local input_map = {
|
|
left = Input.left(),
|
|
down = Input.down(),
|
|
up = Input.up(),
|
|
right = Input.right()
|
|
}
|
|
for dir, pressed in pairs(input_map) do
|
|
if pressed and mg.input_cooldowns[dir] == 0 then
|
|
mg.input_cooldowns[dir] = mg.input_cooldown_duration
|
|
mg.button_pressed_timers[dir] = mg.button_press_duration
|
|
local hit = false
|
|
for i, arrow in ipairs(mg.arrows) do
|
|
if arrow.dir == dir and check_hit(arrow) then
|
|
mg.bar_fill = mg.bar_fill + mg.fill_per_hit
|
|
if mg.bar_fill > mg.max_fill then
|
|
mg.bar_fill = mg.max_fill
|
|
end
|
|
table.remove(mg.arrows, i)
|
|
hit = true
|
|
break
|
|
end
|
|
end
|
|
if not hit then
|
|
mg.bar_fill = mg.bar_fill - 2
|
|
if mg.bar_fill < 0 then
|
|
mg.bar_fill = 0
|
|
end
|
|
mg.total_misses = mg.total_misses + 1
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
--- Draws DDR minigame.
|
|
--- @within MinigameDDRWindow
|
|
function MinigameDDRWindow.draw()
|
|
local mg = Context.minigame_ddr
|
|
if not mg then
|
|
cls(0)
|
|
print("DDR ERROR: Context not initialized", 10, 10, 12)
|
|
print("Press Z to return", 10, 20, 12)
|
|
if Input.select() then
|
|
Window.set_current("game")
|
|
end
|
|
return
|
|
end
|
|
if mg.return_window == "game" then
|
|
GameWindow.draw()
|
|
end
|
|
rect(0, 0, Config.screen.width, Config.screen.height, Config.colors.black)
|
|
rect(mg.bar_x - 2, mg.bar_y - 2, mg.bar_width + 4, mg.bar_height + 4, Config.colors.light_grey)
|
|
rectb(mg.bar_x - 2, mg.bar_y - 2, mg.bar_width + 4, mg.bar_height + 4, Config.colors.dark_grey)
|
|
local fill_width = (mg.bar_fill / mg.max_fill) * mg.bar_width
|
|
if fill_width > 0 then
|
|
local bar_color = Config.colors.light_blue
|
|
if mg.bar_fill > 66 then
|
|
bar_color = Config.colors.item
|
|
elseif mg.bar_fill > 33 then
|
|
bar_color = Config.colors.blue
|
|
end
|
|
rect(mg.bar_x, mg.bar_y, fill_width, mg.bar_height, bar_color)
|
|
end
|
|
local percentage = math.floor((mg.bar_fill / mg.max_fill) * 100)
|
|
Print.text_center(percentage .. "%", mg.bar_x + mg.bar_width / 2, mg.bar_y + 2, Config.colors.black)
|
|
if mg.target_arrows then
|
|
for _, target in ipairs(mg.target_arrows) do
|
|
local is_pressed = mg.button_pressed_timers[target.dir] and mg.button_pressed_timers[target.dir] > 0
|
|
local color = is_pressed and Config.colors.light_blue or Config.colors.light_grey
|
|
draw_arrow(target.x, mg.target_y, target.dir, color)
|
|
end
|
|
end
|
|
if mg.arrows then
|
|
for _, arrow in ipairs(mg.arrows) do
|
|
draw_arrow(arrow.x, arrow.y, arrow.dir, Config.colors.blue)
|
|
end
|
|
end
|
|
Print.text_center("Hit the arrows!", Config.screen.width / 2, mg.bar_y + mg.bar_height + 10, Config.colors.light_grey)
|
|
local debug_y = 60
|
|
if mg.debug_status then
|
|
Print.text_center(mg.debug_status, Config.screen.width / 2, debug_y, Config.colors.item)
|
|
debug_y = debug_y + 10
|
|
end
|
|
if mg.use_pattern then
|
|
Print.text_center(
|
|
"PATTERN MODE - Frame:" .. mg.frame_counter,
|
|
Config.screen.width / 2,
|
|
debug_y,
|
|
Config.colors.light_blue
|
|
)
|
|
if mg.current_song and mg.current_song.pattern then
|
|
Print.text_center(
|
|
"Pattern Len:" .. #mg.current_song.pattern .. " Index:" .. mg.pattern_index,
|
|
Config.screen.width / 2,
|
|
debug_y + 10,
|
|
Config.colors.light_blue
|
|
)
|
|
end
|
|
else
|
|
Print.text_center("RANDOM MODE", Config.screen.width / 2, debug_y, Config.colors.blue)
|
|
end
|
|
if mg.win_timer > 0 then
|
|
Minigame.draw_win_overlay()
|
|
end
|
|
end |