Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmitryshelomanov/snake
https://github.com/dmitryshelomanov/snake
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dmitryshelomanov/snake
- Owner: dmitryshelomanov
- Created: 2019-07-18T10:37:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T19:16:07.000Z (7 months ago)
- Last Synced: 2024-07-24T02:15:18.596Z (3 months ago)
- Language: TypeScript
- Size: 11.4 MB
- Stars: 35
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - snake - Snake Game. (Examples)
README
# Snake Game 🤯
[Try it 👻](https://dmitryshelomanov.github.io/snake/)
[Stress test](https://dmitryshelomanov.github.io/snake/?cellSize=10&fps=60&isVisibleBoard=false&snakeCount=40)
![preview](preview.gif)
## New Feature 🥳!
- Added own to game
- Added differents alghorithms
- Added Code editor for custom user algorimth
- Snakes have become very tenacious (without algorithm)
- Config from URL params## Introduction
Simple snake game with bot wich looking for shorter path to target
Your opportunities
- Toggle different settings
- Add self to game
- Add bricks to arbitrary place
- Use different search algorighmsFeature
- change FPS
- algorithm visualizationNotes
_Use keyword [/_ Note:](https://github.com/dmitryshelomanov/snake/search?q=%2F*+Note%3A&unscoped_q=%2F*+Note%3A) if you want to read algorigthm details\*
## URL Params
- cellSize: number = 50 - Cell with/height
- pageWidth/pageHeight: number = window size - Canvas size
- fps: number = 15 - frame tick
- borderSize: number = 1 - cell border size
- foodCount: number = 50 - food count
- snakeCount: number = 1 - snake count
- isVisibleBoard: boolean = true - board visbile state## Perfomance warning
Visualization is not designed for a large number of objects
I can add deep lvl for alghoritms and this will increase productivity but I can't optimize react renders, but can controll visible state for board
### Data information
- Without sidebar
Snakes count - 100
Foos count - 100renderLoop completed for 0.40ms and logicLoop - for 5ms
- With sidebar
Snakes count - 100
Foos count - 100renderLoop completed for 0.40ms, logicLoop - for 40ms and react took 300-400 ms