SnakeGame Svelte Themes

Snakegame

Simple implementation of the SnakeGame in Svelte/Typescript

Snake Game

A classic Snake game implementation using TypeScript and Svelte. The game features a responsive design, keyboard controls, and increasing difficulty as you score more points.

Features

  • Classic snake gameplay
  • Keyboard controls (Arrow keys or WASD)
  • Score tracking
  • Increasing difficulty
  • Responsive design
  • Game over screen with restart option

Prerequisites

  • Node.js (v16 or higher)
  • npm (v7 or higher)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd snake-game
    
  2. Install dependencies:

    npm install
    

Development

To start the development server:

npm run dev

The game will be available at http://localhost:5173

Testing

To run the test suite:

npm test

Building for Production

To create a production build:

npm run build

The built files will be in the build directory and can be deployed to any static hosting service.

Controls

  • Use Arrow keys or WASD to control the snake
  • The snake moves automatically
  • Eat the red food to grow and increase your score
  • Avoid colliding with yourself
  • The game gets progressively faster as you score more points

License

MIT

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes