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
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 8m27s
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
Lade Leaderboard...
|
||||
</div>
|
||||
|
||||
<button class="big-btn" onclick="location.reload()" style="background: #ff4444; margin-top: 20px;">NOCHMAL SPIELEN</button>
|
||||
<button class="big-btn" onclick="restartGame()" style="background: #ff4444; margin-top: 20px;">ERNEUT VERSUCHEN</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user