2022-05-29 22:55:43 +02:00
|
|
|
function stateRules()
|
2022-05-30 22:44:22 +02:00
|
|
|
|
2022-06-01 21:26:57 +02:00
|
|
|
local fade = split"0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,4,9,10,9,4,2,1"
|
2022-05-30 22:44:22 +02:00
|
|
|
local color = 1
|
|
|
|
|
2022-06-01 23:14:22 +02:00
|
|
|
local function blink(x,y,w,h)
|
2022-05-30 22:44:22 +02:00
|
|
|
rect2(x,y,w,h,fade[color])
|
|
|
|
end
|
|
|
|
|
2022-06-01 23:14:22 +02:00
|
|
|
local function goBack()
|
2022-06-01 21:26:57 +02:00
|
|
|
setState(states.menu)
|
|
|
|
end
|
|
|
|
|
2022-06-02 17:55:52 +02:00
|
|
|
local btnBack = makeButton({x=1, y=118, w=30, h=7, text="❎menu", color=8,
|
2022-06-01 21:26:57 +02:00
|
|
|
onClick=function() goBack() end,
|
|
|
|
onHover=function(btn) btn.color = 7 end})
|
2022-05-30 22:44:22 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
_update=function()
|
|
|
|
if frameCount%8==0 then
|
|
|
|
color += 1
|
|
|
|
end
|
|
|
|
if color>#fade then
|
|
|
|
color = 1
|
|
|
|
end
|
2022-06-01 21:26:57 +02:00
|
|
|
|
|
|
|
-- Back to the menu
|
|
|
|
if btnp(BTN_X) then
|
|
|
|
goBack()
|
|
|
|
end
|
|
|
|
|
|
|
|
btnBack:update()
|
2022-05-30 22:44:22 +02:00
|
|
|
end,
|
|
|
|
|
|
|
|
_draw=function()
|
2022-06-01 21:26:57 +02:00
|
|
|
customFont()
|
|
|
|
|
2022-05-30 22:44:22 +02:00
|
|
|
print("1) yOU CAN'T HAVE MORE THAN\n TWO (2) CONSECUTIVE TILES\n OF THE SAME COLOR", 2,2, 7)
|
|
|
|
local x = 14
|
|
|
|
local y = 28
|
|
|
|
sspr(0,32, 12,12, x,y)
|
|
|
|
spr(2, x+14, y+1)
|
|
|
|
sspr(13,32, 12,12, x+26,y)
|
|
|
|
blink(x-1, y-1, 9, 3)
|
|
|
|
blink(x+25, y-1, 9, 3)
|
|
|
|
blink(x-1, y+8, 12, 3)
|
|
|
|
blink(x+25, y+8, 12, 3)
|
|
|
|
|
|
|
|
x = 75
|
|
|
|
sspr(26,32, 12,12, x,y)
|
|
|
|
spr(2, x+14, y+1)
|
|
|
|
sspr(39,32, 12,12, x+26,y)
|
|
|
|
blink(x+5, y+2, 3, 9)
|
|
|
|
blink(x+31, y+2, 3, 9)
|
|
|
|
|
|
|
|
|
|
|
|
--------------
|
|
|
|
|
|
|
|
x = 44
|
|
|
|
y = 50
|
|
|
|
print("2) eACH LINE CONTAINS AN EQUAL\n NUMBER OF EACH COLOR", 2, y, 7)
|
|
|
|
sspr(52,32, 12,12, x,y+20)
|
|
|
|
spr(2, x+14, y+21)
|
|
|
|
sspr(65,32, 12,12, x+26,y+20)
|
|
|
|
blink(x+5, y+22, 6, 3)
|
|
|
|
blink(x+31, y+22, 6, 3)
|
|
|
|
blink(x-1, y+19, 3, 6)
|
|
|
|
blink(x+25, y+19, 3, 6)
|
|
|
|
|
|
|
|
--------------
|
|
|
|
|
|
|
|
x = 44
|
|
|
|
y = 90
|
|
|
|
print("3) aLL ROWS AND COLUMNS\n ARE DIFFERENT", 2, y, 7)
|
|
|
|
sspr(78,32, 12,12, x,y+20)
|
|
|
|
spr(2, x+14, y+21)
|
|
|
|
sspr(91,32, 12,12, x+26,y+20)
|
|
|
|
blink(x-1, y+25, 12, 6)
|
|
|
|
blink(x+25, y+25, 12, 6)
|
2022-06-01 21:26:57 +02:00
|
|
|
|
|
|
|
--------------
|
|
|
|
|
|
|
|
btnBack:draw()
|
2022-05-30 22:44:22 +02:00
|
|
|
end,
|
|
|
|
}
|
2022-05-29 22:55:43 +02:00
|
|
|
end
|