Learn Before
Idea
The Pong Game Example
After fully configuring your workspace, we can get a simple Kivy pong game app set up. You will need to create a directory for the game and a main.py file.
from kivy.app import App from kivy.uix.widget import Widget class PongGame(Widget): pass class PongApp(App): def build(self): return PongGame() if __name__ == '__main__': PongApp().run()
Running this should only display a black screen. At this point, we have created a simply Kivy app which creates an instance of our PongGame widget class and returns it as the root element for the application UI.
In the next node, we will draw the Pong backround and scores.
0
1
Updated 2021-09-03
Contributors are:
Who are from:
Tags
Python Programming Language
Data Science