Color Game Using Tkinter in Python
Color Game Using Tkinter in Python
Color Game Using Tkinter in Python
Custom Search
COURSES Login
HIRE WITH US
Color game using Tkinter in Python
Prerequisite : Python GUI Tkinter
TKinter is widely used for developing GUI applications. Along with applications, we can also use Tkinter GUI to develop games.
Let’s try to make a game using Tkinter. In this game player has to enter color of the word that appears on the screen and hence the score increases by one,
the total time to play this game is 30 seconds. Colors used in this game are Red, Blue, Green, Pink, Black, Yellow, Orange, White, Purple and Brown. Interface
will display name of different colors in different colors. Player has to identify the color and enter the correct color name to win the game.
Below is the implementation of above game :
if timeleft == 30:
https://www.geeksforgeeks.org/color-game-python/ 1/6
8/28/2019 Color game using Tkinter in Python - GeeksforGeeks
countdown()
score += 1
random.shuffle(colours)
global timeleft
# if a game is in play
if timeleft > 0:
https://www.geeksforgeeks.org/color-game-python/ 2/6
8/28/2019 Color game using Tkinter in Python - GeeksforGeeks
# update the time left label
timeLabel.config(text = "Time left: "
+ str(timeleft))
# Driver Code
timeLabel.pack()
Output :
00:17 00:33
Note : Above code may not run on online IDE because of TKinter module.
Recommended Posts:
Python | Simple FLAMES game using Tkinter
Python GUI - tkinter
Different messages in Tkinter | Python
Python | after method in Tkinter
RadioButton in Tkinter | Python
Python | Binding function in Tkinter
Python | place() method in Tkinter
Python | pack() method in Tkinter
Python | geometry method in Tkinter
https://www.geeksforgeeks.org/color-game-python/ 4/6
8/28/2019 Color game using Tkinter in Python - GeeksforGeeks
iharshwardhan
Check out this Author's contributed articles.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to
[email protected]. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you nd anything incorrect by clicking on the "Improve Article" button below.
3
Based on 2 vote(s)
Please write to us at [email protected] to report any issue with the above content.
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
https://www.geeksforgeeks.org/color-game-python/ 5/6
8/28/2019 Color game using Tkinter in Python - GeeksforGeeks
Load Comments
COMPANY LEARN
About Us Algorithms
Careers Data Structures
Privacy Policy Languages
Contact Us CS Subjects
Video Tutorials
PRACTICE CONTRIBUTE
Courses Write an Article
Company-wise Write Interview Experience
Topic-wise Internships
How to begin? Videos
https://www.geeksforgeeks.org/color-game-python/ 6/6