Skip to content

Commit

Permalink
fix timer on start
Browse files Browse the repository at this point in the history
  • Loading branch information
mentoster2 committed Mar 24, 2024
1 parent d97d496 commit 937a8f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ dist/*
.editorconfig
.env
.ufbt
/.vscode/c_cpp_properties.json
/.vscode/launch.json
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"cortex-debug.variableUseNaturalFormat": false,
"cortex-debug.showRTOS": true,
"cortex-debug.armToolchainPath": "C:/Users/DimaM/.ufbt/toolchain/x86_64-windows/bin",
"cortex-debug.openocdPath": "C:/Users/DimaM/.ufbt/toolchain/x86_64-windows/bin/openocd.EXE",
"cortex-debug.gdbPath": "C:/Users/DimaM/.ufbt/toolchain/x86_64-windows/bin/arm-none-eabi-gdb-py3.EXE",
"cortex-debug.openocdPath": "C:/Users/DimaM/.ufbt/toolchain/x86_64-windows/openocd/bin/openocd.EXE",
"cortex-debug.gdbPath": "C:/Users/DimaM/.ufbt/toolchain/x86_64-windows/bin/arm-none-eabi-gdb-py.BAT",
"editor.formatOnSave": true,
"files.associations": {
"*.scons": "python",
Expand Down
8 changes: 4 additions & 4 deletions flipper_hero.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ void clear_game_data(PluginState* plugin_state) {
plugin_state->timer = 1000;
plugin_state->isGameOver = false;
}

void start_game(PluginState* plugin_state, FuriTimer* timer) {
plugin_state->isGameStarted = true;
furi_timer_start(timer, 10);
generate_arrows(plugin_state);
clear_game_data(plugin_state);
clear_game_data(plugin_state); // Reset game data to initial state first
generate_arrows(plugin_state); // Then generate new arrows
furi_timer_start(timer, 10); // Start the timer after initializing the game state
}

void restart_game(PluginState* plugin_state) {
clear_game_data(plugin_state);
generate_arrows(plugin_state);
Expand Down

0 comments on commit 937a8f2

Please sign in to comment.