diff --git a/_bmad-output/implementation-artifacts/sprint-status.yaml b/_bmad-output/implementation-artifacts/sprint-status.yaml index 2be6f43..31f06b1 100644 --- a/_bmad-output/implementation-artifacts/sprint-status.yaml +++ b/_bmad-output/implementation-artifacts/sprint-status.yaml @@ -47,9 +47,9 @@ development_status: 1-1-project-scaffold-and-dev-environment: review 1-2-game-logic-module: review 1-3-game-board-and-tile-rendering: review - 1-4-game-header-score-display-and-new-game-button: backlog - 1-5-keyboard-input-and-interactive-gameplay: backlog - 1-6-win-and-game-over-overlays: backlog + 1-4-game-header-score-display-and-new-game-button: review + 1-5-keyboard-input-and-interactive-gameplay: review + 1-6-win-and-game-over-overlays: review epic-1-retrospective: optional # Epic 2: Save Progress & Keep Playing diff --git a/src/App.svelte b/src/App.svelte index 8c82ab6..507f130 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,7 +1,10 @@ - - + + + + + + 2048 + + + + Join the numbers and get to the 2048 tile! + + New Game + + + + + + + diff --git a/src/components/GameMessage.svelte b/src/components/GameMessage.svelte new file mode 100644 index 0000000..9e37655 --- /dev/null +++ b/src/components/GameMessage.svelte @@ -0,0 +1,44 @@ + + +{#if type} + + {message} + {#if type === 'win'} + + + Keep going + + + New Game + + + {:else} + + Try again + + {/if} + +{/if} diff --git a/src/components/ScoreBoard.svelte b/src/components/ScoreBoard.svelte new file mode 100644 index 0000000..2d5e597 --- /dev/null +++ b/src/components/ScoreBoard.svelte @@ -0,0 +1,14 @@ + + + + + Score + {score} + + + Best + {bestScore} + + diff --git a/src/lib/input-handler.js b/src/lib/input-handler.js new file mode 100644 index 0000000..a98726a --- /dev/null +++ b/src/lib/input-handler.js @@ -0,0 +1,12 @@ +import { DIRECTIONS } from './constants.js'; + +const KEY_MAP = { + ArrowUp: DIRECTIONS.UP, + ArrowDown: DIRECTIONS.DOWN, + ArrowLeft: DIRECTIONS.LEFT, + ArrowRight: DIRECTIONS.RIGHT, +}; + +export function getDirectionFromKey(key) { + return KEY_MAP[key] || null; +}
Join the numbers and get to the 2048 tile!
{message}