Private
Public Access
1
0

refactor client prediction logic and add tolerance levels; implement restartGame function to reset game state without a full reload
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 8m27s

This commit is contained in:
Sebastian Unterschütz
2026-01-28 12:01:15 +01:00
parent bbe8007b20
commit af08c13255
3 changed files with 50 additions and 15 deletions

View File

@@ -817,6 +817,23 @@ function deleteHighscoreCode(index) {
loadMyCodes(); // Reload display
}
// Restart game without reload
function restartGame() {
console.log('🔄 Restarting game...');
// Reset game state
gameStarted = false;
gameStarting = false;
// Return to main menu
setUIState(UIState.MENU);
// Re-enable start buttons
enableStartButtons();
console.log('✅ Game restarted - ready to play again');
}
// Export functions for WASM to call
window.showMenu = showMenu;
window.hideMenu = hideMenu;
@@ -824,6 +841,7 @@ window.updateLeaderboard = updateLeaderboard;
window.showGameOver = showGameOver;
window.onGameStarted = onGameStarted;
window.saveHighscoreCode = saveHighscoreCode;
window.restartGame = restartGame;
// Initialize on load
initWASM();