Turtle
Turtle
---------------------------------------------------------------------------------------
Abstract:
The final objective is to make a fully featured and functional turtle game. So we
plan to start with small simple steps.
We have decided to make the project using loops to draw a racetrack and create a
racing turtle game.
This project introduces for loops through a fun turtle race game. Loops are used to
draw the racetrack and to make the turtles move a random number of steps each
turn. 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.
Our aim is to design a TURTLE RACE game using python programming. We plan
to achieve this by using the turtle, randit libraries.
We have been inspired by seeing various models of Turtle Race in various sites like
GitHub, codeclub, geekforgeeks etc for its features and simplicity.
At first, we plan to make a simple prototype. and then we like to expand it and add
more features into it. Our final aim is to make a fully featured Turtle Race game
using library.
Modules:
Login
Player Credentials
Game play
Winner declaration
DFD’s:
Libraries:
Turtle:
To make use of the turtle methods and functionalities, we need to import
turtle.”turtle” comes packed with the standard Python package and need not be
installed externally. The roadmap for executing a turtle program follows 4 steps:
-------------------------
#or
import turtle
-------------------------
“Turtle” is a Python feature like a drawing board, which lets us command a turtle
to draw all over it! We can use functions like turtle.forward(…) and turtle.right(…)
which can move the turtle around. Commonly used turtle methods are:
Method Parameter Description
Turtle() None Creates and returns a new
turtle object
forward() amount Moves the turtle forward
by the specified amount
backward() amount Moves the turtle
backward by the
specified amount
right() angle Turns the turtle
clockwise
left() angle Turns the turtle counter
clockwise
penup() None Picks up the turtles pen
pendown() None Puts down the turtles pen
up() None Picks up the turtles pen
down() None Puts down the turtles pen
color() Color name Changes the color of the
turtles pen
fillcolor() Color name Changes the color of the
turtle will use to fill a
polygon
heading() None Returns the current
Heading
position() None Returns the current
position
goto() X,Y Move the turtle to
position X,Y
begin_fill() None Remember the starting
point for a filled polygon
end_fill() None Close the polygon and
fill with the current fill
color
dot() None Leave the dot at the
current position
stamp() None Leaves an impression of
a turtle shape at the
current location
shape() Shape-name Should be ‘arrow’ ,
‘classic’ , ‘Turtle’ or
‘circle’
Role of individual:
References:
https://www.geeksforgeeks.org/turtle-programming-python/
https://projects.raspberrypi.org/en/projects/turtle-race
https://codeclubprojects.org/en-GB/python/turtle-race/