feat: add localStorage highscore module

This commit is contained in:
Ferdinand
2026-03-31 14:18:56 +02:00
parent e014a1e657
commit 0b9a3c9397

9
scores.js Normal file
View File

@@ -0,0 +1,9 @@
function getHighscore(game) {
return parseInt(localStorage.getItem('hs_' + game) || '0', 10);
}
function setHighscore(game, score) {
if (score > getHighscore(game)) {
localStorage.setItem('hs_' + game, score);
}
}