
"navajo white", "dark gray", "violet red", "powder blue", "blue violet"]Ĭanvas.move(stones.id, 25 * j, 25 * i)īall = Ball(canvas, BALL_COLOR, pole, stones, score)Ĭanvas.create_text(250, 250, text="YOU WON !!", fill="yellow", font="Calibri 24 ")Ĭanvas.create_text(250, 250, text="GAME OVER!!", fill="red", font="Calibri 24 ") "orange", "gray", "brown", "white", "blue", "yellow green", STONE_COLOR = ["green", "dark blue", "red", "pink", "violet", "yellow", In the code above, which is first of all you have to design the main screen window. Score = Label(height=50, width=80, text="Score: 00", font="Calibri 14 italic") Designing the Main WindowĬanvas = Canvas(root, width=500, height=500, bd=0, highlightthickness=0, highlightbackground="Red", bg="Black") Importing Random ModuleĪmong these is the random() function, which generates random numbers between 0 and 1. Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications.
Bouncing balls game free download windows how to#
This is the actual coding on How To Create a Bouncing Ball in Python, and you are free to copy this code and download the full source code given below.

Third after creating a python file, Name your python file after that click “ enter“.

Second after creating a project name, “ right click” your project name and then click “ new” after that click the “ python file“. These are the steps on How To Create a Bouncing Ball in Python with Source Codeįirst when you finished installed the Pycharm IDE in your computer, open it and then create a “ project name” after creating a project name click the “ create” button.
