WIP showing clues
This commit is contained in:
@@ -2,6 +2,15 @@ function state_game()
|
||||
|
||||
local board
|
||||
local selected_id = 1
|
||||
local timer_clue = 0
|
||||
|
||||
local function show_clues()
|
||||
-- local result = board:is_valid()
|
||||
-- if result ~= true and result ~= false then
|
||||
-- local rule,what,where = unpack(result)
|
||||
-- --printh("Rule: " .. rule .. " " .. what .. " " .. where[1].. " " .. where[2])
|
||||
-- end
|
||||
end
|
||||
|
||||
local function draw_selected_tile()
|
||||
local x, y = board:draw_coords(selected_id)
|
||||
@@ -17,6 +26,10 @@ function state_game()
|
||||
board:lock_tiles()
|
||||
end
|
||||
|
||||
local function _leave()
|
||||
-- stopcoroutine(show_clues)
|
||||
end
|
||||
|
||||
local function _draw()
|
||||
cls()
|
||||
board:draw()
|
||||
@@ -24,6 +37,10 @@ function state_game()
|
||||
end
|
||||
|
||||
local function _update()
|
||||
timer_clue += 1
|
||||
if timer_clue % 120 == 0 then
|
||||
show_clues()
|
||||
end
|
||||
local size = board:get_size()
|
||||
local x, y = board:idx_xy(selected_id)
|
||||
if btnp(UP) then
|
||||
@@ -51,5 +68,6 @@ function state_game()
|
||||
_enter = _enter,
|
||||
_update = _update,
|
||||
_draw = _draw,
|
||||
_leave = _leave
|
||||
}
|
||||
end
|
||||
Reference in New Issue
Block a user