A fun and interactive dice rolling game built with Svelte where players aim to match target numbers and compete for high scores. The game features both single-player and computer opponent modes, with a dynamic scoring system and persistent high scores.
App.svelte: Main application containerGame.svelte: Core game logic and layoutDice.svelte: Interactive dice component with rolling animationHighScores.svelte: High score display and managementComputerPlayer.svelte: AI opponent logicCounter.svelte: Score display componentThe game uses Svelte's built-in store system for state management:
stores.js: Central state managementscore: Current game scorerollHistory: Track of all dice rollshighScores: Persistent high scoresbonusPoints: Calculated bonus points (10% of current score)totalScore: Combined score with bonus pointsgameMode: Current game mode (single/vs computer)target: Current target number to match# Clone the repository
git clone [your-repo-url]
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
This project is open source and available under the MIT License.