How to Code Realistic Physics in Python Games! PyGame Tutorial (Gravity, Bounce, Throw, Friction)

Published: 27 February 2023
on channel: LeMaster Tech
13,657
422

In this video I show you how to use a number of realistic physics features in your python code and PyGame games! By creating a ball class with easy to change parameters we are able to see how modifying these various parameters can impact our object's movements!

Having realistic bouncing as well as friction and collision and the ability to throw objects with realistic physics is a great way to make your game feel very real and understanding the code behind it is a great way to get better at both python code in general and creating games with the PyGame module!

The code shown in this video is available here:
https://github.com/plemaster01/pygame...

Check out my personal channel here!
‪@peterlemaster8310‬

Consider becoming a super supporter at the link below:
  / lemastertech  

Don't forget to leave a like on the video, subscribe to the channel and leave a comment letting me know what you'd like to see more of in the future!

TIMESTAMPS:
00:00 Intro and Project Description. Physics in Pygame!
03:01 Setting up the PyGame framework
06:15 Draw Outer Walls for the Game
09:49 Setting up a Class in python for Balls
17:24 Applying Gravity to Python Objects with Pygame
20:05 Making Pygame Objects Bounce on Floor Collision
28:40 Selecting a Python Object and getting it to follow the Mouse!
36:40 Releasing and Throwing Objects with the Mouse in Pygame!
43:20 Handle Pygame Object Collision with Walls and Apply Friction!
50:54 Summary, Outro and Showcase! Thanks!


Watch video How to Code Realistic Physics in Python Games! PyGame Tutorial (Gravity, Bounce, Throw, Friction) online without registration, duration hours minute second in high quality. This video was added by user LeMaster Tech 27 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 13,657 once and liked it 422 people.