Skip to content

A classic 'Frogger'-style arcade game built with Python and the Turtle module. Guide the turtle across a busy road to level up! ๐Ÿข๐Ÿš—

Notifications You must be signed in to change notification settings

Spargerx/Turtle_Crossing_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿข Turtle Crossing Game

A classic "Frogger"-style arcade game built entirely in Python using the turtle module. The objective is to guide a small turtle from the bottom of thescreen to the safe zone at the top, dodging a constant stream of fast-moving cars.

turtle_crossing_game

๐ŸŽฎ About the Game

This project demonstrates the principles of Object-Oriented Programming (OOP) by separating the game's components into different classes:

  • Player: The turtle you control.
  • CarManager: Responsible for generating, moving, and managing all the car obstacles.
  • Scoreboard: Keeps track of the player's current level.

The game's difficulty increases with each successful crossing. The cars speed up and spawn more frequently, making each new level a greater challenge.

โœจ Features

  • Classic Arcade Feel: Simple, intuitive, and addictive gameplay.
  • Player Control: Move the turtle forward with the "Up" arrow key.
  • Dynamic Obstacles: Cars are randomly generated at different starting positions and move across the screen.
  • Increasing Difficulty:
    • Cars move faster every time you level up.
    • Cars spawn more frequently as the level increases.
  • Scorekeeping: The scoreboard displays the current level, which increases with each successful crossing.
  • Collision Detection: The game instantly ends if the turtle collides with a car.

๐Ÿ› ๏ธ Built With

๐Ÿš€ How to Play

Prerequisites

You must have Python 3 installed on your system. The turtle module is included in the Python standard library, so no extra installations are needed.

Running the Game

  1. Clone the repository:
    git clone [https://github.com/Spargerx/Turtle_Crossing_game.git](https://github.com/Spargerx/Turtle_Crossing_game.git)
  2. Navigate to the project directory:
    cd Turtle_Crossing_game
  3. Run the game:
    python main.py

Controls

  • Move Forward: Up Arrow

๐Ÿ“‚ Project Structure

The game is built using four main Python files:

  • main.py: This is the entry point of the game. It sets up the screen, initializes all the game objects (player, cars, scoreboard), and contains the main game loop and event listeners.
  • player.py: Defines the Player class (which inherits from Turtle). It handles the turtle's starting position, appearance, and move logic.
  • car_manager.py: Defines the CarManager class. This class is responsible for creating new cars, moving all cars, and increasing their speed when the player levels up.
  • scoreboard.py: Defines the Scoreboard class (which inherits from Turtle). It handles writing the current level to the screen and displaying the "GAME OVER" message.

About

A classic 'Frogger'-style arcade game built with Python and the Turtle module. Guide the turtle across a busy road to level up! ๐Ÿข๐Ÿš—

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages