Python Bouncing Ball Simulator 1

preview_player
Показать описание
NEED HELP?

❤️❤️ SHOW SOME LOVE AND SUPPORT THE CHANNEL ❤️❤️

Click Join and Become a Channel Member Today!
Channel members can get preferential comment replies, early access to new content, members only live streams, and access to my private Discord.

Amazon Affiliate Links

Other Affiliate Links

LINKS

LEARN MORE PYTHON

LEARN MORE JAVA

#Python #Tutorial #Beginner
Рекомендации по теме
Комментарии
Автор

I figured out why the circle bounces less high with each iteration:

Evertime it goes "underground" and then starts to go up again, gravity is still being applied. The ball goes a bit under 0; -300 before it checks its position again (and thus flips its speed), and so whilst its under and the speed inversed, its speed is being slowed due to gravity.

The fix to this is simply to check if the ball is above -300 before applying gravity. That's it. It wasnt a rounding error, but just an issue with the way that the speed was calculated. This solution is good because it doesnt require estimation or applying an arbitrary factor the the speed everytime it bounces, and its also super easy to implement and understand.

louisrialland
Автор

Thank you so much! I've been trying to get the Samsung TV bounce thing, and I only know Python, this is amazing! This is my favorite coding channel! Thank you!

MemeScope
Автор

how can i add music & sycn beat with balls

Minshalife
Автор

This is the only gravity tutorial I could find that helped me on the iOS app “Pythonista” wow thank you!

flame
Автор

Great tutorial amazing really do recommend to everyone! (Who can do python ofcourse!) :-)

Unseeable_web
Автор

This man did in seven minutes what i couldnt do in seven days. Respect.

imnotonmars
Автор

note: if if you get an error
Traceback (most recent call last):
File "main.py", line 5, in <module>
wn = turtle.screen()
AttributeError: module 'turtle' has no attribute 'screen'
you need to put Screen with caps

Leon-yeml
Автор

Nice, another tutorial. Now I possibly could try to make a ping pong game in python as well. My current one is in Opengl c++ but getting more practice in other languages is always good.

valizeth
Автор

Quick and clear. Will definietly visit your channel in the future again.

theblackumbrella
Автор

I have just started learning the basics of Python. My end goal is to create simulations in Physics. Can you please guide me on what should i do next after i get the basics of Python?

shreyjain
Автор

I am using the software of 'Scratch' to do this as it is all I have access to and is what I'm used to. Now my question; how come my ball keeps bouncing higher and higher? It does not bounce back to the same position? Do you know any mistakes I could have made or do you think it is probably the program I'm using?

serkona
Автор

This is awesome. Great and simple explanations. Thank you!!

ryanhenderson
Автор

Great tutorial! This physics stuff is really what I'm looking for! Defenitely going to watch the other video's as well!

dataninjanl
Автор

Chris, you are running on MAC, on my Windows, Python 3.8, import turtle, this does not work. I
I do not have the support for some of the turtle functions like ball.dy, ball.dx, ball.setx, ball.sety
any suggestions ?

eigertner
Автор

this is the best tutorial of python that i ever seen. Thanks!

thenotsomebody
Автор

Do you by chance know why when the ball moves up/down, the black background kinda "overlaps" it briefly? Idk how to exactly describe it, but part of the circle disappears basically when it moves

theredsparrow
Автор

After incorporating gravity the ball doesn't bounce back to it's original height. Each bounce the height is decreasing slowly. Even in your animation you can see it. Why is that? Otherwise great tutorial!

timbuktu
Автор

I wrote the same code as you did above but when comes to running it, the new window for the animation starts "Not Responding" everytime. Why is it happening and how could i fix it?

s.k.j.
Автор

You're fantastic, very simple code and well explained, I like it

keepfighting
Автор

I have a question. Why is my turtle kinda flickering when its moving? I did everything you did, and i dont get what is the problem with that.

markomestrovic