Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dmitryshelomanov/snake


https://github.com/dmitryshelomanov/snake

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

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 algorighms

Feature

- change FPS
- algorithm visualization

Notes

_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 - 100

renderLoop completed for 0.40ms and logicLoop - for 5ms

- With sidebar

Snakes count - 100
Foos count - 100

renderLoop completed for 0.40ms, logicLoop - for 40ms and react took 300-400 ms