This is a simple Turtle Crossing game built using Python's Turtle graphics library. The player controls a turtle trying to cross the road while avoiding cars.
-
Clone the repository:
git clone https://github.com/vimukthiwi/turtle-crossing-game.git
-
Navigate to the project directory:
cd turtle-crossing-game
-
Ensure you have Python installed (preferably 3.7+).
-
Install the required dependencies:
pip install -r requirements.txt
To start the game, run:
python main.py
Use the Up
arrow key to move the turtle up. The goal is to reach the top of the screen without getting hit by a car.
- The player controls a turtle that moves upwards when the
Up
arrow key is pressed. - Cars move from the right side of the screen to the left.
- If the turtle collides with a car, the game ends.
- Each time the turtle reaches the top, the level increases, and the cars move faster.
Handles the player (turtle) movement and checks if the player has reached the finish line.
Manages car creation, movement, and speed adjustments.
Manages the score display, updates, and game over message.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
### Example File Structure
Ensure your project directory has the following structure for the README instructions to work properly:
turtle-crossing-game/ │ ├── player.py ├── car_manager.py ├── scoreboard.py ├── main.py ├── requirements.txt └── README.md