Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkief/svelte-snake
A snake game written in Svelte and TypeScript
https://github.com/pkief/svelte-snake
canvas game snake svelte typescript
Last synced: 27 days ago
JSON representation
A snake game written in Svelte and TypeScript
- Host: GitHub
- URL: https://github.com/pkief/svelte-snake
- Owner: PKief
- License: mit
- Created: 2022-08-26T18:17:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-27T08:42:57.000Z (about 2 years ago)
- Last Synced: 2024-05-01T22:08:25.552Z (6 months ago)
- Topics: canvas, game, snake, svelte, typescript
- Language: TypeScript
- Homepage: https://pkief.com/svelte-snake
- Size: 1.72 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
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](https://svelte.dev/). 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](https://nodejs.org/en/).
#### Install dependencies
```
npm install
```#### Start local development server
```
npm start
```#### Generate production bundle
```
npm run build
```