Skip to content

Added AI vs Human Snail game #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 021_AI_vs_Human_Snail_Game/Images/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 021_AI_vs_Human_Snail_Game/Images/Snail2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 021_AI_vs_Human_Snail_Game/Images/Snail3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 021_AI_vs_Human_Snail_Game/Images/splash1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 021_AI_vs_Human_Snail_Game/Images/splash2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 021_AI_vs_Human_Snail_Game/Images/vs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions 021_AI_vs_Human_Snail_Game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Snails Game

## Getting Started

To play the Snails Game, you need to have Python installed on your computer. You'll also need to install the Arcade library if you haven't already. You can install Arcade using pip:

pip install arcade

Once you have Python and Arcade installed, you can run the game by executing the provided Python script (snails_game.py).

## Game Rules
- The game is played on a 10x10 grid.
- There are two players: "human1" and "BOT" (Computer).
- The game starts with a menu screen. Press any key to start the game.

## Controls
**Player "human1"**
- Uses the keyboard to control their snail.
- Use the arrow keys (up, down, left, right) to move the snail.
- The objective is to collect points and avoid obstacles.

**Player "BOT"**
- Controlled by the computer and tries to collect points as well.

## Game Elements
- **Snails:** Player "human1" is represented by a blue snail, and "BOT" is represented by a red snail.
- **Points:** The snails can collect points on the grid.
- **Obstacles:** There are obstacles on the grid that the snails must avoid.
- **Winning Conditions:** The game ends when one player reaches a certain score or when it's a draw.

## Gameplay
- Player "human1" takes turns moving their snail using the arrow keys.
- The snail collects points by moving onto them.
- The game keeps track of the score for both players.
- The computer-controlled "BOT" takes its turn intelligently to collect points.
- The game continues until one player wins or it's a draw.

## Winning the Game
- If one player accumulates a higher score than the other and reaches a certain threshold, they win the game.
- If both players reach the threshold simultaneously, the game is declared a draw.
- The game announces the winner or a draw on the game over screen.

## Game Over
- When the game is over, the game over screen is displayed.
- The winner (or draw) is announced on this screen.
- Click to return to the main menu and start a new game.

## Enjoy the Snails Game!
Have fun playing the Snails Game! Challenge your friends or compete against the computer-controlled "BOT." Collect points, avoid obstacles, and aim to win. Good luck!

1 change: 1 addition & 0 deletions 021_AI_vs_Human_Snail_Game/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arcade==2.6.5
Loading