Fidget Spinner game using python

Fidget Spinner

Fidget spinner has been the best sell for the business people as it is all over the world. You know it is rotated only with the help of the hands but why not the command?
We can write the command and then give it a go. As you can see from the below output what it really looks like:
Like I only have uploaded this picture of the output but when you rotate it, it will change into different color. I have inserted only three colors on it but you can change it after downloading the file.

Things you need to install before running this file:

You need to install python 2.7 or python 3.

You need to install python libraries like: turtle and free games.

You have to press the space button to rotate the fidget spinner. It will continuously spin only if you don’t press the spacebar. The code for the game is given below:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

from turtle import *

state={'turn':0}

def spinner():

"Draw fidget spinner."

clear()

angle=state['turn']/10

right(angle)

forward(100)

dot(120,'red')

back(100)

right(120)

forward(100)

dot(120,'green')

back(100)

right(120)

forward(100)

dot(120,'blue')

back(100)

right(120)

update()

def animate():

"Animate fidget spinner."

ifstate['turn']&gt;0:

state['turn']-=1

spinner()

ontimer(animate,20)

def flick():

"Flick fidget spinner."

state['turn']+=10

setup(420,420,370,0)

hideturtle()

tracer(False)

width(20)

onkey(flick,'space')

listen()

animate()

done()

You can edit the rotation, color and the shape and size and make it more attractive on your own way.
Click on below button to download this game:Download
Thank you,