Make a fun turtle racing game by using loops and random numbers to make the turtles race. If you have a group of people to play the game, each person picks a turtle and the one that gets the furthest is the winner!
A fun turtle racing game like this one:
By making your turtle race game, you will learn how to:
Use for loops to draw the race track and to make the turtles move
Use the write function to put text on the screen
Create multiple turtles, each with their own characteristics
Use random numbers to make the race outcome unpredictable
A computer or tablet capable of accessing the online interactive Python environment called Trinket. You can create a trinket.io account using your google school account; or
If you don’t want to create an account you can use the embedded interactive trinket below to run code and see what happens; or
You can use a computer that has the Python programme installed.
Sign in to your trinket.io account, click on your name and then select ‘New Trinket’ and ‘Python’ from the drop-down menus.
Use this link to go to the Code Club online project: projects.raspberrypi.org/en/projects/turtle-race
Follow each step in the project, type code into your own trinket. You can look at the embedded trinket below for help if you get stuck.
You will see that some commands can be shortened e.g. forward = fd; backward = bk; right = rt; and left =lt.