filmov
tv
Kivy Tutorial #4 - Adding the Ball | Pong Game
![preview_player](https://i.ytimg.com/vi/4I4LRiLjIQk/maxresdefault.jpg)
Показать описание
In this video we will be adding the ball to our Pong Game
Creating the Pong Ball -
- self: always refer to the current widget
- Size not in ellipse size because when drawing outside it takes the center as reference but when drawing inside canvas it takes left hand side as reference
Steps
1) Create the PongBall class
2) Create the PongBall rule
3) Add the PongBall Widget inside the the PongGame Widget and center it
Moving the ball - Prepare
- NumericProperty - Tell the program that this is a number. Python might need it but if this program is going to run on as a mobile app it needs to know whether is number is an integer or not. Because programming languages like Java are based on it
- ReferenceListProperty - To change or get both of these values at the same time
- Difference between speed and velocity - Velocity also has directions. And to get the direction we need to convert it a vector
- Latest Position = Velocity + Current Position
Next video - Movement Mechanics
#python #kivy #pythongui
Creating the Pong Ball -
- self: always refer to the current widget
- Size not in ellipse size because when drawing outside it takes the center as reference but when drawing inside canvas it takes left hand side as reference
Steps
1) Create the PongBall class
2) Create the PongBall rule
3) Add the PongBall Widget inside the the PongGame Widget and center it
Moving the ball - Prepare
- NumericProperty - Tell the program that this is a number. Python might need it but if this program is going to run on as a mobile app it needs to know whether is number is an integer or not. Because programming languages like Java are based on it
- ReferenceListProperty - To change or get both of these values at the same time
- Difference between speed and velocity - Velocity also has directions. And to get the direction we need to convert it a vector
- Latest Position = Velocity + Current Position
Next video - Movement Mechanics
#python #kivy #pythongui
Комментарии