Skip to content
davidCrejenovschiPublic

About

A simple implementation of the legendary Snake game, built from scratch with java, using JavaFX framework, featuring an autonomous built-in AI agent.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

62 Commits

Folders and files

Repository files navigation

🐍 Snake Adventure

Project Demo

Java 21 JavaFX Gradle Neural Network

📦 Supported Platforms

Windows: .exe


📖 About The Project

Snake Adventure started as a classic arcade game implementation developed in Java using the JavaFX framework, focusing on a clean UI and modular architecture.

The project has now evolved into a Machine Learning experiment, offering a dual experience for the user:

  • 🎮 Manual Play: You can test your own navigation skills in the classic game mode.
  • 🤖 AI Demonstration: The game features a built-in, pre-trained AI agent. You can watch in real-time as the neural network makes complex decisions, demonstrating survival strategies learned through hundreds of generations of artificial evolution.

The AI system is powered by a custom-built Feedforward Neural Network optimized via a Genetic Algorithm, demonstrating how autonomous agents can learn complex spatial tasks without any human-coded rules.


📁 For a deep dive into the AI code architecture, access the technical documentation here


📈 Learning Curve

The graph below demonstrates the exponential growth of the AI's fitness score across generations, utilizing a logarithmic scale:

Project Demo


📜 Credits & License

All sound effects are used under the Mixkit Free License, which allows for use in personal and non-commercial projects, like this one. GIF created using VEED.io. Created for learning purposes only.


🎮 Play It Now (No Setup Required)

You don't need to install Java or an IDE to play the game.

  1. Go to the Releases page.
  2. Download the latest Snake_Adventure_v1.1_Windows.zip file.
  3. Extract the folder anywhere on your PC.
  4. Run SnakeAdventure.exe and enjoy!

🛠️ Local Development Setup

Follow these steps to set up and run this project using IntelliJ IDEA.

1. Clone the Repository

Open your terminal and run these commands:

git clone https://github.com/davidCrejenovschi/Snake.git
cd Snake

2. Open in IntelliJ IDEA

  1. Launch IntelliJ IDEA.
  2. Select Open and navigate to the cloned project folder.
  3. Select the build.gradle file and click Open as Project.
  4. Wait for IntelliJ to automatically download Gradle and finish the sync.

3. Run the Application

You can run the project directly from the terminal using the Gradle wrapper.

On Windows:

.\gradlew.bat run

On macOS / Linux:

chmod +x gradlew
./gradlew run

About

A simple implementation of the legendary Snake game, built from scratch with java, using JavaFX framework, featuring an autonomous built-in AI agent.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages