New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bunch of minor bugfixes and code cleanup #2
Conversation
…mer won't be triggered if exit manually
check on explicit congratulation timer existence instead of 'if any timer exists -> that was congratulation exit, reset save' if move b/w cells and then quit very fast, there will be non-congratulation timer left from animation logic, so that previous code would remove the save. global variable is not that good solution, but does solve the problem
Merge my personal bugfixes
Latest build: sudoku.pdx.zip |
@@ -10,6 +10,7 @@ import "checkBoxButtons" | |||
local gfx <const> = playdate.graphics | |||
local menu = playdate.getSystemMenu() | |||
|
|||
local congratulationsTimer = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't really like global vars, but if exit to menu w/o waiting for the timer finish, then it will still be triggered once 10 seconds pass.
We do remove the sprites later down the load, but the timer will still exist and will trigger the logic behind 'congratulations sprite'.
@@ -86,6 +86,12 @@ end | |||
function setUpTitleScreen() | |||
menu:removeAllMenuItems() | |||
gfx.sprite.removeAll() | |||
|
|||
if congratulationsTimer ~= nil then | |||
removeGameData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so that if we go to title screen, and there was a congratulation screen before, we clean saved state (e.g. button Continue will disappear since we finished the play)
@@ -416,6 +415,7 @@ function turnOnNotingMode(bool, board) | |||
board.boardData.isNoting = true | |||
if board.boardData.selected ~= nil and board.boardData.selected.status ~= status.Given then | |||
board.boardData.selected.number = 0 | |||
board.boardData.selected.status = status["Empty"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we initiate notation mode we clean the previous status in addition to resetting the number.
so that, if there was a number provided by user, then status won't be left equal to Given or Guessed.
otherwise, if we initiate notation mode, togglePossibleNumber
won't work because it checks if status is Empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather low quality, I just cropped the launchImage file to 32x32
@@ -4,6 +4,7 @@ import "CoreLibs/sprites" | |||
import "CoreLibs/timer" | |||
|
|||
local gfx <const> = playdate.graphics | |||
local possibleNumberFont = gfx.font.new("font-Bitmore") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we only read the font once, and then reuse it. this particular update fixed the lag on my device
Thank you so much for helping and fixing so many problems in the codebase! |
function removeGameData() | ||
playdate.datastore.delete("board_table") | ||
end | ||
function useless() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it, since it's useless :)
Thank you for creating such a nice game =^__^= |
This PR is a continuation of #1 and supersedes it , provides other bugfixes I added in the fork: