Written by: Marlon Colca
Posted on 22 Sep 2025 - 12 days ago
typescript nodejs vue games
You made it to the finish line! Let us consolidate what keeps the experience sticky and outline where you can go from here.
You made it to the finish line! Let us consolidate what keeps the experience sticky and outline where you can go from here.
useScores.ts
mirrors the pattern you saw in settings, providing a tiny persistence layer:
const STORAGE_SCORES = "cm-scores";
function load(): ScoreEntry[] {
try {
return JSON.parse(localStorage.getItem(STORAGE_SCORES) || "[]");
} catch {
return [];
}
}
function save(scores: ScoreEntry[]) {
localStorage.setItem(STORAGE_SCORES, JSON.stringify(scores.slice(0, 20)));
}
export function useScores() {
const scores = ref<ScoreEntry[]>(load());
function addScore(entry: ScoreEntry) {
scores.value = [entry, ...scores.value].slice(0, 30);
save(scores.value);
}
return { scores, addScore };
}
ScoresList.vue
.previewLeftMs
broadcasts a live countdown chip so players know when the round begins.clearPreviewTimers()
on unmount prevents memory leaks when navigating away.Polish the README, capture a short GIF of gameplay, and show your project to the world. The skills you exercised—composable architecture, reactive timers, client-side persistence—translate directly to richer Vue apps.
Thank you for following along! Keep experimenting, keep refactoring, and most of all, keep having fun. 🎉