Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Python Course - Doing the Car Race Game with Turtle Module
Rating: 4.6 out of 5(8 ratings)
2,035 students

Python Course - Doing the Car Race Game with Turtle Module

Car Race Game with Python Turtle Module, Python Game Development
Last updated 2/2022
English
English [Auto],

What you'll learn

  • You will be able to do games by using Turtle Module.
  • Can use "Class" to make projects.
  • Learn how to write your own Python programs.
  • Be confident in your Python programming abilities and knowledge so that you may apply for Python programming jobs.
  • Use Python to make your daily life easier.
  • You will learn Turtle Module very well.

Course content

1 section14 lectures1h 29m total length
  • Setup the Screen1:53

    Set up the turtle screen by creating a Screen object, set its size to 600 by 800, and show that clicking closes the window for the car race game.

  • Logic of the game1:55

    Design and implement a car race game using turtle by drawing the road with five lines, spawning cars, and controlling a turtle with keyboard left and right to avoid crashes.

  • Draw the Road16:05

    Learn to draw a road with Python turtle by creating a subclass and using inheritance. Adjust pen size, coordinate movements, and headings to render a wider road.

  • Make drawing Faster3:28

    Speed up turtle drawing by adjusting pen speed, enabling screen tracer, and updating the screen only after the drawing finishes in a game loop.

  • Create Player4:14

    Create a player for a turtle-based car race game in Python by defining a Player class with inheritance, importing from a file, and configuring its shape, heading, size, and color.

  • Move the car with Keypress4:31

    Learn to move the turtle car in Python using the turtle module with keypress, defining right and left functions that adjust the x coordinate by 60 and bind arrow keys.

  • Create Cars11:07

    Create random cars using a turtle-based car manager, place them at random road locations, adjust their shape and size, and move them to build a playable car race game.

  • Arrange the distance between cars6:34

    Arrange the distance between cars in a turtle race by tracking the last car in a list and creating a new car only when the gap grows.

  • Change the color of the cars randomly3:41

    Change car colors randomly in a Python turtle game using color modes and RGB (0–255), apply color method, adjust speed, and trigger game over on crashes or leaving the road.

  • Detect when we are out of road.2:45

    Detect when the turtle leaves the road by checking x coordinates, stopping the game if x > 150 or x < -150, and planning a scoreboard later.

  • Detect Collision7:16

    Detect collisions between the turtle and cars by checking x coordinates and center distance, using a car manager to stop the game when distance is under 70.

  • Make a score board14:35

    Create a scoreboard object in a python turtle car race game, initialize score to zero, update the display as cars pass, center the text, and implement game over text.

  • Fix the bug5:24

    Fix the collision bug by using the ABC function to compare car and player x coordinates, treating differences under one as the same; convert the Python files to an executable.

  • Convert py to exe file5:34

    Convert python project files into a single executable using PyInstaller, so others can run the turtle-based car race game without installing Python.

Requirements

  • You should know the basic Python knowledge.

Description

Python is a programming language that is intended for both total beginners who have never coded before and experienced programmers who wish to broaden their career choices by learning Python. Python is, in reality, one of the most widely used programming languages in the world, with major corporations such as Google using it in mission-critical systems such as Google Search to great effect. Python, on the other hand, is the most popular programming language for machine learning, data science, and artificial intelligence. If you want to get one of those high-paying positions, you'll need to be an expert in Python, which is exactly what you'll learn from this course.

You will master the Turtle module with Python programming language in this course. Firstly, we will learn the basics about the Turtle module, then we will do the Car Race Game Game by using "Turtle Module". In this way, you will understand how the "class" work in Python.

Once you've completed the course, you'll be ready to submit applications with confidence for Python programming positions. And, sure, this is true even if you have never coded in your life before to now. You may become employable and useful in the eyes of future employers if you have the appropriate abilities, which you will acquire in this course and practice.

If you have any questions about this course, please contact me as soon as possible and I will respond to you the same day. With the help of this course, you will learn how to make your lives simpler by becoming familiar with the Python programming language. This will keep you motivated on a daily basis and prevent you from becoming bored while studying Python.

Who this course is for:

  • Who want to learn Turtle Module.
  • Who want to learn OOP very well.
  • Who want to learn Python in an effective way.
  • Who want to communicate with computer.
  • Who want to use Python skills to get better jobs.