An AI built with Brain.js that plays snake.
Clone the project
git clone https://github.com/PhoenixR49/snake-game-ai
Go to the project directory
cd snake-game-ai
Install dependencies
npm install
npm run start
This file converts the dataset's text data into JSON data that can be used in Brain.js.
This file is automatically executed during model training.
File used to train the model, manages how it will be trained.
To train the AI, you can run the command npm run train
in the application folder.
See also the Brain.js training.
The main AI file. It loads the trained model from the model.json
file located in the data
folder.
Important
The AI is currently unable to know its body size, so the snake runs into itself. I'm currently looking for a way to use the FullSnakeXY
data in the dataset so that it can be used. If anyone has any ideas on how to do this, please let me know in an issue or PR.
Server: Node, Express, Socket.IO
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
See the original license here.