back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/puzzle.cpp
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-11-10 15:16:31 +0300
committerscratko <m@scratko.xyz>2024-11-11 22:04:21 +0300
commit9023f43291b894f7670df2ffe513808ef6360954 (patch)
treee7b4c4d3689bcda7f4bfc949bc3f2ac1d580fc07 /puzzle.cpp
parent0ddc597a0f2eeb0dc49f8a6ab4a8af0d615b6ece (diff)
downloadpicture-puzzle-9023f43291b894f7670df2ffe513808ef6360954.tar.gz
picture-puzzle-9023f43291b894f7670df2ffe513808ef6360954.tar.bz2
picture-puzzle-9023f43291b894f7670df2ffe513808ef6360954.zip
Added end game check
Diffstat (limited to 'puzzle.cpp')
-rw-r--r--puzzle.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/puzzle.cpp b/puzzle.cpp
index 50b32af..ca55ef9 100644
--- a/puzzle.cpp
+++ b/puzzle.cpp
@@ -47,6 +47,7 @@ void GameParams::NextUntestedPuzzles()
/*
* ======== creating puzzles ===========
*/
+ win->begin();
for(int i = 0; i < puzzle_pieces; ++i) {
tmp_puzzle =
std::unique_ptr<Puzzle>(new Puzzle(standard_puzzle_coordinates[i].x,
@@ -65,6 +66,7 @@ void GameParams::NextUntestedPuzzles()
tmp_puzzle->callback(press_button_callback, this);
puzzles.push_back(std::move(tmp_puzzle));
}
+ win->end();
ResetFreePuzzles();
}
@@ -84,10 +86,3 @@ void GameParams::CreateNewPuzzles()
NextUntestedPuzzles();
} while(!IsSolvability());
}
-
-void GameParams::NewGame()
-{
- ResetFreePuzzles();
- CreateNewPuzzles();
- SetXYEmptyBox(215, 215);
-}