working on levels

This commit is contained in:
2025-10-16 17:18:31 +01:00
parent e4f5be1a56
commit d02a8e9618
5 changed files with 95 additions and 11 deletions
+4 -1
View File
@@ -3,7 +3,7 @@ import "@vimazing/vim-snake/game.css";
import { useKeyBindings } from "./useKeyBindings";
function App() {
const { containerRef, gameStatus, scoreManager, keyLog, score } = useGame(30, 20, useKeyBindings);
const { containerRef, gameStatus, scoreManager, keyLog, score, level } = useGame(30, 20, useKeyBindings);
const formatTime = (ms: number) => {
const seconds = Math.floor(ms / 1000);
@@ -20,6 +20,9 @@ function App() {
<div className="px-3 py-1 bg-muted rounded">
Time: {formatTime(scoreManager.timeValue)}
</div>
<div className="px-3 py-1 bg-muted rounded">
Level: {level}
</div>
<div className="px-3 py-1 bg-muted rounded">
Score: {score}
</div>