working on levels
This commit is contained in:
+4
-1
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user