A snake game which can be played by using a neural network.
Created as FFHS project in fall 2020 in collaboration with @ramonator00 and @SandroBuerki.
Following modes are available:
- arcade mode (classic manual gameplay)
- neural network mode (configure a neural network and see what happens)
- demo mode (trained neural network)
Additional features:
- extended statistics, available by browser via webserver
- various themes available
Available key commands:
Key | Command |
---|---|
UP, W | set direction of next move to 'up' (manual mode only) |
RIGHT, D | set direction of next move to 'right' (manual mode only) |
DOWN, S | set direction of next move to 'down' (manual mode only) |
LEFT, A | set direction of next move to 'left' (manual mode only) |
SPACE, ENTER | start or stop a game |
V | 'verbose': activate/deactivate real time statistics (neural network mode only) |
P | 'position': changes position of real time statistics (neural network mode only) |
The neural network was implemented by using a genetic algorithm.
ai
here, all ai related code is ingame
the basic game loicmain
this package contains the main method (inMain.java
), configuration and game mode handlingui
all ui related codewebserver
all webserver related code
Clone the repository with:
git clone https://github.com/lpapailiou/snakeML your-target-path
For further help, click here.