Skip to content

Python training - 100 days of code: The complete Python Pro Bootcamp for 2023

Notifications You must be signed in to change notification settings

shelbyblanton/turtle-crossing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Crossing Game (a la Frogger)

By Dr. Angela Yu

Day 23 of 100: The Turtle Crossing Capstone Project

Project Specs

Using Turtle Screen capabilities, program a Turtle Crossing game in the style of Frogger where a user guides a turtle across traffic to reach the other side.

The game ends if the turtle collides with a car.

This application is written with Python 3.11.

alt text

Main Features

This game application features a turtle that needs to cross a road to get to the other side. It has to dodge traffic to do so.

Cars are made up of multi-color rectangles randomly added to the screen and constantly moving from right to left.

The current score is tracked at the top of the screen.

Usage & Requirements

This project uses three classes:

  • Player
  • Car Manager
  • Scoreboard

Workflow

The user guides the turtle through traffic by pressing the up and down arrow keys.

When the turtle makes it across, the use scores a point and two things happen:

  1. The turtle returns to the bottom of the screen to make its next attempt to cross
  2. Traffic speeds up

If the turtle collides with any of the cars on the road, the game is stopped and the words "Game Over" display in the center of the screen.

alt text

Getting Started

All of the commands below should be typed into the Python terminal of your IDE (I use PyCharm for my Python Development).

First, clone the repository from Github and switch to the new directory:

$ git clone git@github.com:shelbyblanton/turtle-crossing-game.git

Then open the project in PyCharm.

Setup is complete!

Click Run in PyCharm to see the app in action.

Game Adjustments

To increase or decrease the speed that traffic travels as the turtle successfully crosses the road, edit the MOVE_INCREMENT = 10 constant variable in the CarManager class.

Author & Credits

Programmed by M. Shelby Blanton under the instructional guidance of Dr. Angela Yu via Udemy.com.

About

Python training - 100 days of code: The complete Python Pro Bootcamp for 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages