git repos / blockattack-game

commit 72f219a9

Poul Sander · 2025-04-06 17:00
72f219a965dd1cd0d441ea2bf2804045b15bf457 patch · browse files
parent 6046ca3f56a5a50c750f8ae81717d7c7a1fb685b

Load the given puzzle. This might need to be done different.

Changed files

M source/code/puzzle_editor/PuzzleEditorState.cpp before
diff --git a/source/code/puzzle_editor/PuzzleEditorState.cpp b/source/code/puzzle_editor/PuzzleEditorState.cpp index 1eaf298..d51a4bf 100644 --- a/source/code/puzzle_editor/PuzzleEditorState.cpp +++ b/source/code/puzzle_editor/PuzzleEditorState.cpp
@@ -69,6 +69,13 @@ void PuzzleEditorState::Draw(SDL_Renderer* target) {
for (int i = 0; i < puzzle_count; ++i) {
if (ImGui::Selectable(std::to_string(i).c_str(), this->selected_puzzle == i)) {
this->selected_puzzle = i;
+ BlockGameStartInfo s;
+ s.ticks = 0;
+ s.level = i+1;
+ s.puzzleMode = true;
+ if (game) {
+ game->NewGame(s);
+ }
}
}
ImGui::End();