Compare commits
No commits in common. "a7697fa1b2169d6e462d541b127bccb73acb6026" and "119155a90321b75fad6ac4b4a466760ac8ae53e7" have entirely different histories.
a7697fa1b2
...
119155a903
@ -96,9 +96,8 @@ function board:undo()
|
||||
if (not self.checkpoint) return
|
||||
if (not self.watcher:intercept("undo")) sounds:dire() return
|
||||
sounds:menu()
|
||||
local current_checkpoint=checkpoint:new(self,self.checkpoint.card)
|
||||
self.checkpoint:apply(self)
|
||||
self.checkpoint=current_checkpoint
|
||||
self.checkpoint=nil
|
||||
end
|
||||
|
||||
function board:on_idle()
|
||||
|
10
cursor.lua
10
cursor.lua
@ -81,17 +81,13 @@ function cursor:toggle_grab()
|
||||
self:restore_hover()
|
||||
sounds:menu()
|
||||
elseif acc==acceptance_state.no_move or acc==acceptance_state.would_not_accept then
|
||||
self:drop_grab()
|
||||
else
|
||||
assert(false,"invalid acceptance state")
|
||||
end
|
||||
end
|
||||
|
||||
function cursor:drop_grab()
|
||||
if (not self.board.watcher:intercept("cancel")) sounds:dire() return
|
||||
self.grabbed=nil
|
||||
self:restore_hover()
|
||||
sounds:menu()
|
||||
else
|
||||
assert(false,"invalid acceptance state")
|
||||
end
|
||||
end
|
||||
|
||||
function cursor:update()
|
||||
|
@ -41,13 +41,7 @@ function state_gameround:update()
|
||||
if (btnp(2)) self.board.cursor:move_y(-1)
|
||||
if (btnp(3)) self.board.cursor:move_y(1)
|
||||
if (btnp(4)) self.board.cursor:toggle_grab()
|
||||
if btnp(5) and self.restart_frames < 4 then
|
||||
if self.board.cursor:grabbed_card() then
|
||||
self.board.cursor:drop_grab()
|
||||
else
|
||||
self.board:undo()
|
||||
end
|
||||
end
|
||||
if (btnp(5)) self.board:undo()
|
||||
end
|
||||
if (self.board:is_won()) self.outcome="win" self.done=true main.state_manager:push(state_wonround:new(self.board))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user