Clear Code is a underrated channel that only lucky people can find, and he's really know how to teach and make people understanding problem step bt step.
Pymunk? Holy... I always create the whole energy, speed, momentum, gravity logic into pygame to make my balls run. Im glad theres a library for it. I havent done it before, but doing balls colliding with rects and calculating the rotational and regular speeds and reactions would be hell.
I grew up in Germany, but things got weird and I ended up living in lots of different countries. It's a bit weird... I do miss some good Döner though :D
pos_x = int(ball.body.position.x) ValueError: cannot convert float NaN to integer >>> if you faced this error , a quick fix is to pass two integers as arguments to body = pymunk.Body(1,1,pymunk.Body.STATIC) in the function definition for static_ball(). great tutorial, thanks a lot!
That was a very cool tutorial Thanks Clear Code btw you can get a satisfactory result if you use below co-ordinates balls.append(static_ball(space,(200,100))) balls.append(static_ball(space,(310,175))) balls.append(static_ball(space,(200,250))) balls.append(static_ball(space,(310,325)))
@@ClearCode Thanks so much, im sorry i hadnt seen this earlier thanks for the help with this and the entire project, it was a fun one and Im hoping to code it more
really enjoyed that. looking forward to more projects. the apple i found has a boarder around it so it looks awkward. do you have a git link for yours?
Hi! do you have a download link for the images or code by any chance... im getting some problems and idk how to fix, perhaps it could be because ive loaded the wrong images or incorrect code
Pymunk does nothing but physics calculations and returns numbers, although only for 2d spaces. So yeah, you could connect it, all you need are the ursina screen dimensions.
bruh i used to litteraly create physics manualy by giving the balls an x velociy and a y velocty and adding the force of grvity to theem and add the velocity to the balls position thoose days are over now
I have a problem: if event.type = pygame.MOUSEBUTTONDOWN: ^ SyntaxError: invalid syntax when I change to: if event.type == pygame.MOUSEBUTTONDOWN: the syntax does not error anymore but: TypeError: create_apple() missing 1 required positional argument: 'pos' can someone help me? 😅
Phython users:A really basic physic simulator in 23 minutes and with a lot of code Unity users:Rigidbody 2D/3D Collider 2D/3D a complicated physics simulator in 2 seconds and with zero code *GO BRRR*
Clear Code is a underrated channel that only lucky people can find, and he's really know how to teach and make people understanding problem step bt step.
Totally Agree
OMG, smooth, you actually explain, underatted!!! You deserve more, i did not even know pymunk existed!
Thanks for the good tutorials!
This is fantastic.
Physics simulation made easy on python.
I spent ages doing this on Matlab and one afternoon on this.
Thanks for the lesson
Pymunk? Holy... I always create the whole energy, speed, momentum, gravity logic into pygame to make my balls run. Im glad theres a library for it. I havent done it before, but doing balls colliding with rects and calculating the rotational and regular speeds and reactions would be hell.
Check out the pymunk website, it has lots of examples of cool projects
How could you do that on your own
u made me feel dumb
Full physics...... Physics+Python=Phython
Nope
This is amazing, never knew this library existed. I'm never making my own physics again, thanks.
Just found your channel, brilliant tutorials.
I hope (and think) u channel grows fast :)
Much love from Germany!!!
Vielen dank :)
@@ClearCode wait are you actually from Germany? :D
I grew up in Germany, but things got weird and I ended up living in lots of different countries. It's a bit weird... I do miss some good Döner though :D
@@ClearCode facts, can you make a video about your atom settings, I love that font
@@Tila1 hey, I am actually using the sublime code editor, here are the settings: {
"caret_extra_bottom": 1,
"caret_extra_top": 1,
"caret_extra_width": 0.5,
"caret_style": "solid",
"color_scheme": "Packages/Base16 Color Schemes/Themes/base16-one-light.tmTheme",
"font_size": 28,
"gutter": true,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_numbers": false,
"line_padding_bottom": 4,
"line_padding_top": 4,
"mini_diff": false,
"overlay_scroll_bars": "enabled",
"theme": "ayu-light.sublime-theme"
}
Man you did an excellent work your channel is no one in TH-cam 👌👌👌🤘
You are the best tutor I have ever seen
This is the only pygame tutorial that makes use of pymunk...
I didn't even know it existed.
Awesome tutorial, you deserve more subscribers.
Bro how can you only 430 subs, You deserve moreee!!!
dont worry he got 2k now!
Now about 10k
I'm just starting out as a programmer and you should have a lot more subs then you have now :)
pos_x = int(ball.body.position.x)
ValueError: cannot convert float NaN to integer
>>>
if you faced this error , a quick fix is to pass two integers as arguments to
body = pymunk.Body(1,1,pymunk.Body.STATIC)
in the function definition for static_ball().
great tutorial, thanks a lot!
you are amazing!!! keep doing good stuff
I want more videos on Pymunk !!!
This video is really helpful thanks for sharing your knowledge with us 🙂
This video very helpfull, I really like this video
Great video!
13:03 I somehow didn't get an error but I just copy paste what you do, I assume it's because of an update since this video is from 2 years ago
That was a very cool tutorial
Thanks Clear Code btw you can get a satisfactory result if you use below co-ordinates
balls.append(static_ball(space,(200,100)))
balls.append(static_ball(space,(310,175)))
balls.append(static_ball(space,(200,250)))
balls.append(static_ball(space,(310,325)))
i will try and tell you
good video men!!!
Great video! Though my code won't run with me constantly moving my mouse, otherwise it will pause until I move it again, what's going on here?
you messed up the indentation for the game loop!
@@ClearCode Thanks so much, im sorry i hadnt seen this earlier thanks for the help with this and the entire project, it was a fun one and Im hoping to code it more
At 20:25 I don't know if it's newer versions of the modules, but I had to use a == or it was failing.
He made a mistake, it must be ==
Thank you it works sir! I'll use it for my presentation
My kingdom for a portable version of Python with GUI editor and Pygame all connected. I’d use it with all 100+ of my game design students
pls do a kinematic body tutorial!
great video
This is super helpful!! I just wonder if we can get the pixel array of the simulated animation?
But now, the apple.body.position attribute returns integer.... Maybe due to updates
gravity and step function is not working
is that because of any new update
I am your 1100th liker
what should I do if the image of the apple is too big? what is the code to change its size? and where is the proper placement in the script?
Kick to PEP8, as always.
Holy Fuck I'm never writing collision functions in pygame ever again
Thank you so muchhhhhhhhhhhh
thank's that video was very helpful
So good thanks! However after collisions I would expect some rotations on the apples, is this to do with friction?
i think you could add it yourself, idk how but check out pymunk's documentaries or keep searching, you might find one
I have the same problem and i cant figure it out.. Im too stupid for the pymnunk dopcumerntaions
really enjoyed that. looking forward to more projects. the apple i found has a boarder around it so it looks awkward. do you have a git link for yours?
That's a problem with your png
Nice.. could one simulating a 3D floating object in water with python?
Hi! do you have a download link for the images or code by any chance... im getting some problems and idk how to fix, perhaps it could be because ive loaded the wrong images or incorrect code
Hy it's possible to do a Simulation of a Alternative Photographic Processes? Thanks
Hey man, what is the IDE/Editor you're using in the video? Im really interested...
Sublime text
@@ClearCode What theme is that?
I get this error:
AttributeError: module 'pymunk.body' has no attribute 'STATIC'
What should i do?
Check for capital "B" in body. You actually want to instance of a Body() class, like:
body = pymunk.Body(body_type=pymunk.Body.STATIC)
Hey , Is there any way to create a non-blocky, curvy terrain in pygame??????
how can i create rectangle body for sprite
Would it be possible to use pymunk with ursina?
Pymunk does nothing but physics calculations and returns numbers, although only for 2d spaces. So yeah, you could connect it, all you need are the ursina screen dimensions.
@@ClearCode thank you
Great vid
Can we get the source somewhere?
i dont know why I cant see any response on the screen
It has correct background color, but neither ball nor apple are visible.
code is exactly same and I am using pycharm professional, not sure why it is not working.
So i have made some changes and now it is working. Awesome explanation.
@Arpan Rai i got it, just switch the position of screen fill to the top of the while loop.
Do the same thing by using Ursina please
bruh i used to litteraly create physics manualy by giving the balls an x velociy and a y velocty and adding the force of grvity to theem and add the velocity to the balls position thoose days are over now
do you have a copy of this code posted anywhere? Thank you!
How can I make the image smaller?
What text editor do you use?
I have a problem:
if event.type = pygame.MOUSEBUTTONDOWN:
^
SyntaxError: invalid syntax
when I change to:
if event.type == pygame.MOUSEBUTTONDOWN:
the syntax does not error anymore but:
TypeError: create_apple() missing 1 required positional argument: 'pos'
can someone help me? 😅
Awesome
Can I add movement to this? Or can I just watch
Dont work... Color of background isn't changing. And i dont see ball, i tryed to make it white. But its not work...
hey,is pymunk uses lot of cpu and is pygame fps decrese
My screen in PyGame is black. No errors showing up. Someone please help me!
not sure if it matters to you anymore, but move the code at the end under the while loop
Can games created using pygame be deployed?
sir ! how can i run the code that i created in pymunk in my website?\
Hello! I just have a simple question that I want the answer of. How do you add anti-aliasing to the circles?
check out the gfxdraw library of python, it can do that. www.pygame.org/docs/ref/gfxdraw.html
@@ClearCode will you ever make another video like this but this time with classes?
Please upload about poly too. instead of circles.
What text editor you use ? :D
The original python ide
When I put the apple it won't show
thank you
Um clear code? i got a problem
The object of type "int" has no len().
SOMEONE HELP PLS
you created an integer when you were supposed to make a list
i did what you said what's wrong
@@blaukampfflieger check your code u might make a type somewhere it happened to me many times.
why...
why u dont follow the rules of pep 8
rly good tutorial btw
please give code file link
Kyu Abhishek ne maya ko apne bhai ke paas bheja?
Kyu?
what is this, I have not commented this
Lol, it's you.
It is very laggy for me
You should have a source code
static balls
pymunk. 1sst off im not gay, 2nd off im a monké but not monk alr
Give the code!!!!!!!!!!!!!!!!!
you have so big screen
Phython users:A really basic physic simulator in 23 minutes and with a lot of code
Unity users:Rigidbody 2D/3D Collider 2D/3D a complicated physics simulator in 2 seconds and with zero code *GO BRRR*