
Learn Python game development with Pygame and Pymc to build physics-driven games, including a pool game with realistic ball physics. Build an Angry Birds clone with slingshots and destructible structures.
Learn how pygame uses a top-left origin for pixel coordinates, sets the display surface size, and draws a rectangle with the rect method using RGB colors.
Learn to draw shapes in pygame using the draw module, focusing on rect, line, and circle methods with x, y, width, height on a surface.
Learn to draw shapes in pygame on a display surface using drawrect, draw.line, draw.circle, and polygon commands, while mastering the top-left origin and coordinate system for x and y movement.
Learn to create colored circles in pygame by using rgb color codes from online pickers or rapid tables. Pass the surface, position, radius, and optional thickness to pygame.draw.circle.
Explore how a Python pygame template builds a game loop, initializing the display, handling quit events, and updating the screen to render game elements.
Learn to render a 50 by 50 purple rectangle as the player in a Pygame window by defining x and y as game variables and drawing on the window surface.
Move the rectangle on the pi game screen by listening to key presses and updating its x and y by 50 units using a, d, w, s.
Learn how to implement smooth rectangle movement in a Python game by setting a 30 fps game loop, using a tick method to limit speed, and enforcing window boundaries.
Learn how to confine movement inside a pygame window by clamping x and y with top, bottom, left, and right checks, subtracting width for safe boundaries.
Explore how to compute the distance between two points on the coordinate plane using axis-aligned cases and the distance formula with Pythagoras.
Explore scalar quantities defined by magnitude alone and vector quantities defined by magnitude and direction, with examples like speed, distance, wind velocity, displacement, and momentum.
Learn how any 3d vector decomposes into i hat, j hat, and k hat components, expresses as magnitude times a unit vector, and adds via components.
Install and import the Pi Monk library, set up a space with gravity and 60 fps loop, and add objects like circles or polygons to build Angry Bird style gameplay.
Create a Pymunk space to host objects and handle collisions, movement, and gravity with a unitless x,y tuple, advancing the simulation via space.step(dt) at a chosen frame rate.
Create a ball in a pi monkey space by defining the space, gravity, and a ball's body and shape; compare static and dynamic bodies, mass, radius, and elasticity.
Add static boundaries to the lattice game using Pymunk, creating four walls with elasticity and friction to bounce and confine a dynamic ball under gravity.
Apply impulse to the ball on mouse click using Pymunk, applying force at the center to move it, and adjust elasticity and mass to control bounce and speed.
Apply impulse in a pymunk space by calculating the distance and angle to the mouse click, then decompose force into fx and fy using cos and sin.
Download and organize pool game assets from the resources, including ball images 1–16, the cue ball, cue stick, and pool table, to begin coding in the next video.
Set up a Pygame-based pool game boilerplate by creating main.py, loading assets, initializing Pygame, and building a 1200 by 678 window with a bottom score panel and a game loop.
Create pool game balls with the pymunk library by defining a ball as a circle shape with mass, added to a space, then drawn on the pi game surface.
Create a cue ball with radius 25 at (400, 100), then apply a leftward impulse on mouse down using pi monkey physics, updating the space each frame.
Learn to implement linear friction in a Python pool game using a pivot joint between the ball and a static body, tuning max bias, max force, and elasticity.
Load the table image with transparency, blit it to the screen after setting the display, loading from assets/images/table.png, and define six boundaries to reflect balls within the pool table.
Create static polygon boundaries in Pymunk by collecting cushion corners with the mouse, forming six elastic cushions that bounce the pool ball back into the table.
Create 16 balls, including the cue ball, by looping five rows and five columns, using the diameter and the initial pose to position the balls list into a rack.
Position and shape the balls for a Python pool game, set the cue ball position and radius, then observe ball movement and reflections at the boundaries.
Arrange the balls in a 5 by 5 grid by looping through columns and rows, calculating x and y positions with the diameter and radius, and applying row displacement.
Load and render 16 ball images onto the table, map them to Pi Monk objects, and align visuals with the blue circles by adjusting ball radius and diameter.
Create a pi game object, load its image, and rotate it by an angle that follows the mouse. Center it on the cue ball and draw it.
Add the cue ball to the balls list so the cue stick follows the cue ball, then note the rotation issue to be solved next video.
Implement cue stick rotation by computing the angle from mouse position using arctan(y/x) and an update function, ensuring the cue rotates opposite the mouse pointer toward the cue ball.
Align the cue stick to the cue ball, compute the angle, and rotate opposite to mouse direction; hide the cue stick while the ball moves.
Learn to hide the cue stick during shots by checking each ball’s velocity in the main loop and toggling a boolean flag to stop cue updates until all balls stop.
Learn to apply impulse from the cue angle in pool by computing x and y impulses with cos and sin (in radians) and applying a force within a limit.
Start the force at zero and let players adjust power and direction in a pool game. Hold the mouse to increase power and release to apply the impulse.
Holding the mouse button increases the force by 100 units with each moment, releasing applies an impulse and resets the force to zero, with a lower limit of zero.
Apply a continuous force within a max boundary, and flip the force direction when the limit is reached, using default values of zero for force and one for direction.
Begin a python game using boilerplate code for an angry bird style project with pi game, including a main.py entry point, a resources folder, and a source folder.
Explore how to organize a resources folder for a Python game, using sprite sheets, birds, background, blocks, pigs, buttons, and a sling to build Angry Birds style gameplay.
Explore the source folder and inspect the JSON map, understand level structures from one to six with red bird and bluebird labels, and review the boilerplate pygame setup.
Learn to load a map and display the background in a Python pygame project by loading a JSON map file from the data/map folder.
Set up the background by creating a background object from the tool class, loading gfx, getting its rect, scaling with the background multiplier, and positioning the busy rect to display.
Implement the draw function to render the background by filling the surface, update the surface with current time and mouse data, and fix the label import in state.
Use the fill function to set grass green, and the blit function to display a background image at a specific x and y with width and height.
Learn to display the sling on the background by loading the sling image, setting x and y coordinates and width and height, and testing with sling one and sling two.
Define a vector from p0 to p1 to capture the rope direction. Normalize this vector to get the unit vector, using a small epsilon when magnitude is zero.
Display a rope-like sling by rendering two lines connected at a point, initialize it unclicked, and use mouse position and press to display and stretch the rope near the sling.
Learn to draw the sling rope in a Python game by computing the sling mouse vector, unit vector, and distance, then render the rope with pygame while handling rope length.
Extend rope up to 90 units using the mouse distance from the sling. Draw along the unit vector toward the mouse, and show a tiny idle rope when not clicked.
Use the unit vector to give the rope a direction with unit magnitude so it follows the mouse pointer.
Define a bird class and an angry bird subclass in Python using pygame, load its pngs from resources, and implement frame-based animation with position and rect for the game.
Define and animate a bird class by loading frames, managing frame rects, and rendering with Pygame, while updating position and angle for red and blue birds.
Extend the parent class to implement the red bird. Initialize with x and y, load the angry bird sprite sheet, and build the five frame rects for rendering.
Set up the red bird and prepare the blue bird, initialize the bird list and sling, and render and update bird positions using map data and unit vectors.
Draw red bird by iterating through all birds and rendering them on the surface; manage rope length, sling, and idle state, and enable throwing and animation in future steps.
Discover how to remove the bird when the rope is released by switching from idle to attack state, handling input, updating positions, and removing the active bird from the list.
Create a physics module using Pi game and Pi monk to handle gravity, collisions, coordinate conversion, and drawing the bird's path and its interactions with pigs, blocks, and lines.
Create a static ground by building a static body and lines with a segment, add it to the space, and configure gravity, elasticity, friction, and collision type so objects collide.
Implement a collision handler to detect when the bird collides with the ground via a post solve callback, creating and managing the arbiter data within the physics space.
Update the game state by performing five small updates per frame for stability, remove dead birds, convert pi monk positions to pi game, and refresh bird paths and angles.
Update the bird path by syncing the path timer with time and appending positions, and handle collisions by reducing velocity on ground contact and toggling the big red bird's jump.
Explore how the physics file initializes, resets, and updates the bird's collision with ground, while sling interactions drive the attack state and render the bird with physics.
Compute the bird's impulse angle from dy and dx using atan to control the sling in the pool game, applying gravity and testing the launch in main.py.
Add board animation in Python pool game by cycling image frames with intervals and frame indices, handling explored and explode states.
Create a block system in Python for a pool game, implementing a block class with glass and wood blocks, beam shapes, mass logic, and physics to build and destroy architectures.
Create the beam glass class with a constructor for position, type, and direction, compute mass and wrecked coordinates, and set up blocks with physics using polygon and circle shapes.
Add physics to blocks by configuring position, size, space, and mass; instantiate circles with radius from width, and update, remove, and draw blocks within the game loop.
Configure physics for a polygon and a circle by setting moment, mass, position, shape, friction, and collision type; add to space and run the game.
Learn to handle bird and block collisions in a physics-driven pool game by implementing post-solve collision handlers, arbiter checks, and impulse-based damage that updates block life.
Add a pig enemy by implementing a pig class with normal, big, and small variants in pygame, animating frames from a sprite sheet and managing life against the Angry Bird.
Set up the pig component with images and animations, then create pig instances from map data and add circular pig bodies to pi monk physics for rendering and collision.
Add a pig post-solve collision handler with the bird to apply gravity, update pig positions in pygame coordinates, center the image, and remove pigs when their life reaches zero.
Handle pig collision by implementing post-solve logic for pig with line, block, and bird, adjusting pig velocity on ground contact and applying damage based on collision impulse.
Test the game to trigger explosions and make them disappear, monitor pig life and block damage, and plan to add score.
Create a button class in pygame to manage next and replay buttons by loading images, computing rects, positioning, scaling, and drawing with click detection.
Implement and manage a display button by importing the button class, setting up next and replay buttons, handling mouse clicks, and updating game state and labels.
Add an exploding feature to the pool game by triggering explosions on collisions between the bird, wood, and pig, and implement init explode and exploding state transitions.
Implements explosion physics by creating a circular body with mass and radius, applying a counterclockwise impulse, assigning a collision type, adding to space, and tracking distance from its original position.
Learn to implement an explosion in python by creating a physics explode object, computing positions with math.pi, sine, and cosine, and appending explosions to a list for simulation.
Check explosion status, update timers, and remove exploded objects from space. Implement post-solve collision handlers to detect collisions and apply damage when impulse exceeds a minimum threshold.
Learn how to implement score tracking in a Python pygame game by updating scores on object removal, rendering with fonts, and handling level progression and restart logic.
Learn how to implement victory and loss checks in a Python game by tracking pigs, birds, and game state, using an over timer, updating levels and scores.
Unleash your creativity and dive into the exciting world of game development with Python! This comprehensive course is designed for beginners and aspiring game developers to build physics-based games from scratch using the powerful Pygame and Pymunk libraries.
You will start by mastering the fundamentals of Pygame, learning how to create game loops, handle events, manage sprites, and design interactive game interfaces. Next, you’ll delve into the core concepts of Pymunk, an easy-to-use 2D physics engine, to simulate realistic collisions, movements, and dynamics in your games.
By combining these skills, you’ll create two complete, engaging games:
Pool Game: Design a fully functional billiards game, complete with accurate ball physics, collision detection, and smooth gameplay.
Angry Birds Clone: Build your version of this classic physics-based game, implementing catapult mechanics, projectile motion, and destructible structures.
This hands-on course includes:
Step-by-step guidance for mastering Pygame and Pymunk.
Practical coding exercises and projects to solidify your understanding.
Insights into game design and debugging techniques.
By the end of this course, you’ll have the skills and confidence to create your own games and explore endless possibilities in game development. Whether you're a hobbyist or aiming for a career in gaming, this course is your launchpad!