Kivy Tutorial #4 - Adding the Ball | Pong Game

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

man every indian programming guides shouldve more than 10mil views man, theyve been helping me throughout my college years now thanks alot

Mayo
Автор

Wow that's amazing, it is the best video about Kivy, I can understand everything, even if I don't speak English very good. I wish your videos had a lot views. Keep going. Thank you

БахтиёржонПашшоев
Автор

Thanks a lot, not really sure why you only have 1.5 views for such a quality video

gaviziskind
Автор

i am not only learning kivy but also physics :D

prashasthnair
Автор

These videos are very informative and well-explained. Thank you so much!

acdundore
Автор

" Why am I explaining the joke so much" .. because you are self-conscious XD

glintacekuriakose
Автор

Why did you put * before self? What is that for?

nikolatesla
Автор

Do self refers to class we are working on?

pokeera
Автор

Can we import everything from kivy using single import function?

AnkitSingh-xcem
Автор

PLEASE HELP!
When I'm putting the ball to the center, some error happening it said kivy.factory.FactoryExeption: Unknown class <PongBall>

knnthrssl
Автор

13. # why not self.pos += Vector(*self.velocity) ?
and what does that * mean here?

gelek
Автор

How it got its own shape 🙄 ( round in the middle )

TechnoSyke
Автор

It's showing attribute error for the centre_x
Pls help me out

ashutoshtiwary
Автор

"It's like Inception center..." Hilarious.

biuku
Автор

can someone say me where is the problem ? i've imported ReferenceListProperty but pycharm says that name 'ReferencelistProperty' is not defined . I know that someone can think that i didn't import protperties, but i did it.

nnx
Автор

hey, love your videos! if i may ask, how do u make the rectangles opaque so that the ball/character I create doesn't go through the rectangle u created? I'm trying to create a maze game and would like to incorporate multiple rectangles within to create the maze, and have my character start at the bottom left and reach the exit!

amrishsandhu
Автор

Can anyone tell me what stands for root?
why we are using root.width not only width??

tarangrover
Автор

I might be stupid to ask this, but I am pretty new to this, so Imma ask anyway! He said we are going to import this to android, can we also import it to apple? Or is it only going to be on android?

durp
Автор

The comment written at 9:18 minutes is pedagogically incorrect. It should have been
# latest position = current velocity * time difference + current position
Of course, it is just a comment. One can ignore it.
In that case, ignore this comment as well.

dennymmg
Автор

you said 11 centers in 36 seconds 3:34 to 4:10

adityajha