From 1964ad87f9c3ff33c4424c07f4427991d92c8f64 Mon Sep 17 00:00:00 2001 From: Matteo Benedetto Date: Mon, 23 Dec 2024 23:12:05 +0100 Subject: [PATCH] =?UTF-8?q?Aggiungi=20il=20file=20README.md=20con=20dettag?= =?UTF-8?q?li=20sul=20gioco,=20funzionalit=C3=A0,=20installazione=20e=20st?= =?UTF-8?q?ruttura=20del=20progetto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/README.md b/README.md index e69de29..b45b840 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,73 @@ +# Mice! + +Mice! is a strategic game where players must kill rats with bombs before they reproduce and become too numerous. The game is a clone of the classic game Rats! for Windows 95. + +## Features + +- **Maze Generation**: Randomly generated mazes using Depth First Search (DFS) algorithm. +- **Units**: Different types of units such as rats, bombs, and points with specific behaviors. +- **Graphics**: Custom graphics for maze tiles, units, and effects. +- **Sound Effects**: Audio feedback for various game events. +- **Scoring**: Points system to track player progress. + +## Technical Details + +- **Language**: Python 3 +- **Libraries**: + - `sdl2` for graphics and window management + - `Pillow` for image processing + - `uuid` for unique unit identification + - `subprocess` for playing sound effects + - `tkinter` for maze generation visualization +- **Game Loop**: The game uses a main loop to handle events, update game state, and render graphics. +- **Collision Detection**: Each unit checks for collisions with other units and walls. +- **Sound Management**: Sound effects are managed using the `subprocess` module to play audio files. +- **Environment Variables**: + - `SDL_VIDEODRIVER` to set the video driver + - `RESOLUTION` to set the screen resolution +- **Engine**: The game engine is built using SDL2, providing efficient rendering and handling of game events. The engine supports: + - **Image Loading**: Using `Pillow` to load and process images. + - **Text Rendering**: Custom fonts and text rendering using SDL2's text capabilities. + - **Sound Playback**: Integration with SDL2's audio features for sound effects. + - **Joystick Support**: Handling joystick input for game controls. + - **Window Management**: Fullscreen and windowed modes, with adjustable resolution. + +## Installation + +1. **Clone the repository**: + ```bash + git clone https://github.com/yourusername/mice-maze-game.git + cd mice-maze-game + ``` +2. **Create a virtual environment**: + ```bash + python3 -m venv venv + source venv/bin/activate + ``` +3. **Install the dependencies**: + ```bash + pip install -r requirements.txt + ``` +4. **Run the game**: + ```bash + python rats.py + ``` + +## Project Files + +- `maze.py`: Contains the `MazeGenerator` class for generating and visualizing the maze. +- `rats.py`: Main game file that initializes the game and handles game logic. +- `engine/controls.py`: Contains the `KeyBindings` class for handling keyboard input. +- `engine/maze.py`: Contains the `Map` class for loading and managing the maze structure. +- `engine/sdl2.py`: Contains the `GameWindow` class for SDL2 window management and rendering. +- `units/bomb.py`: Contains the `Bomb` and `Explosion` classes for bomb units. +- `units/rat.py`: Contains the `Rat`, `Male`, and `Female` classes for rat units. +- `units/points.py`: Contains the `Point` class for point units. +- `assets/`: Directory containing game assets such as images and fonts. +- `sound/`: Directory containing sound effects. +- `README.md`: This file, containing information about the project. +- `requirements.txt`: Lists the Python dependencies for the project. +- `.env`: Environment variables for the project. +- `.gitignore`: Specifies files and directories to be ignored by Git. +- `scores.txt`: File for storing high scores. +