svelte-snake Svelte Themes

Svelte Snake

A snake game written in Svelte and TypeScript


Game logo

Snake

First class Snake game. Powered by Svelte.

Game instructions

By either pressing one of the arrow keys on the keyboard or by using swipe gestures on a mobile device the Snake is starting to move. In the same way, the direction of the snake can be changed while it is moving. Since the snake is hungry, it would like to eat as many items as possible. Each item eaten makes the snake a little bigger, which also restricts the freedom of movement. The goal is to swallow as many items as possible.

Technological background

This game was implemented with the frontend framework Svelte. The code base is written with TypeScript and Webpack is used for bundling into executable JavaScript code in the browser. For the rendering of the game logic a Canvas element is used.

Installation instructions

To get the game up and running on a local machine it's necessary to install the runtime Node.js.

Install dependencies

npm install

Start local development server

npm start

Generate production bundle

npm run build

Top categories

Loading Svelte Themes