GithubHelp home page GithubHelp logo

education's Introduction

Snake Game with AI

This project is a Rust-based implementation of the classic Snake game with an additional feature: an AI player. It employs ggez for rendering the game environment and tch-rs for interfacing with the Torch library, enabling the neural network to learn and adapt to the gameplay.

Features

  • AI Learning: Employs a neural network to learn the Snake game mechanics and improve over time.
  • Classic Snake Mechanics: Includes all the traditional gameplay elements such as eating food to grow longer and avoiding collisions.
  • Graphics Rendering: Utilizes the ggez crate for rendering graphics, providing a visually appealing gaming experience.
  • Adjustable Settings: Allows for customization of grid size, tile size, update rate, and more.

Installation

Before you begin, ensure that Rust and Cargo are installed on your machine. Refer to the Rust Installation Guide for instructions.

To get started with this project:

  1. Clone the repository:

    git clone https://nikita-voronoy/education.git
    cd education
  2. Build the project using Cargo:

    cargo build --release
  3. Run the game:

    cargo run

Gameplay

  • Use W, A, S, D or arrow keys for snake movement.
  • Grow your snake by eating food, and increase your score with each item consumed.
  • Avoid hitting the walls or the snake's own body.

AI Gameplay

The game initiates with an AI-controlled snake by default. The AI decides the snake's moves based on the neural network's predictions.

Development

If you're interested in contributing to the development of this Snake game or wish to customize it further:

  1. The AI logic can be tweaked within the ai module.
  2. Game settings can be modified in the Game struct.

Feel free to fork this project and submit pull requests with your improvements!

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

education's People

Contributors

nikita-voronoy avatar

Stargazers

Kris avatar Vladyslav Vasiliev avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.