CompSci 190
Fall 2022
Programming Games
FOCUS Section

List Practice with a Carnival Race

It takes hard work and determination to win a typical race but, in this game, it will take luck and the right sequence of random values. Much like the standard carnival race game where you use a water pistol to squirt a target that makes a character move along the track — even if you shoot as hard and steadily as possible, it does not seem to guarantee a win.

Getting Started

Try writing this game from scratch by creating a New PyCharm project and replace the default code given in the Python file with the basic code below to get started:

"""
Created on Sep 22, 2022

@author: YOUR NAME HERE!!

This module represents a carnival Racer game, in which a number of turtles randomly race across the screen.
"""
import random
import turtle

# Set up the game scene
theScreen = turtle.Screen()
theScreen.tracer(False)

# Play the game forever
theScreen.mainloop()

Here is a video discussing getting started on the project

Where will you start when you are completely in control?

Steps to Create the Game

Do you want to start by creating a single racer that moves across the screen?

By creating all the racers lined up on left side of the screen?

Or setting the look or theme for your game?

Whichever order you decide on, make sure to work in small iterative steps so you can quickly see the results to know you are on the right track.

Finally, to actually see a racing games like at the local carnival, you will need to update the game_step() function to:

When done, it should appear like the turtles are racing to the right side of the window (but we know they are just moving randomly :)

Add Interactivity

As of now, it is not much of a game since the player can only watch the action.

Add the ability for the player to impact the game by speeding up a racer by giving it an extra call to your random move function:

Or come up with another way to play — it's your game!

Extending the Game

Once you have the basic game features working, add more features to experiment and turn your game into one where a player dodges (or catches) obstacles.

Feel free to be creative, but remember to keep your ideas at your skill level since there are still many things we have yet to learn, but here are some ideas to get you started:

Some ideas include ParachuteNight Driver, Frogger, Fruit Ninja, or your experience with other dodging style games.

In the comment at the top of the Python file add: