This game is build in python with basic knowledge

Here is Step by Step Info

Screen Shot 2017-08-05 at 11.47.25 am.png

Grid Design:

I have used turtle library of python to make grid with following code :

penup()
goto(-250,0)
speed(0)
for step in range(1,11):
 write(step)
 right(90)
 pendown()
 forward(140)
 penup()
 backward(140)
 left(90)
 forward(30)

 

Making Turtles :

I have used four different to draw turtles in diff colors with following code :

colors = ["red","blue","green","orange"]

turtles = []

for tu in range(1,5):
 tur = Turtle()
 tur.color(colors[tu-1])
 tur.shape("turtle")
 tur.penup()
 tur.goto(-280,-30*tu)
 tur.pendown()
 turtles.append({"dis":0,"tur":tur,"name":colors[tu-1]})

Running Turtles :

For code of running checkout while loop

https://github.com/Sameer-Deswal/python-learning/blob/master/Turtle_Race.py

Thanks!!

Thanks

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: