Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.44 KB

README.md

File metadata and controls

25 lines (19 loc) · 1.44 KB

Intelligent_Snake

This project is an implementation of the classic Snake Game using Python and Pygame but with a twist, incorporating an artificial intelligence (AI) mechanism to control the snake.

Features

  • AI-Driven Gameplay: Intelligent Snake employs the A* search algorithm to navigate the game grid, making gameplay decisions based on the shortest path to the fruit.
  • The player has the option to take control of the snake or let the AI play the game, press spacebar to toggle in between these.
  • The game is built using the Pygame library, which handles the game graphics and real-time updates.
  • The game keeps track of the score and the time elapsed.

Project Structure

The project has a main Python script where the game logic resides. The script uses Pygame, a popular Python library for game development.

Assets

There are several assets used in the game including images for fruits and the snake's head. These assets are stored in the assets folder.

Limitations

  • The AI uses the A* pathfinding algorithm, which always chooses the shortest path to the fruit. As such, it might not always make the optimal move in terms of long-term strategy.
  • It is possible that the snake cannot find a valid path to the fruit if the snakes length exceeds a certain point.