Challenges

Featured Challenge:
#184 — Elastic Collisions

What happens when two circles collide in a p5.js canvas? In this video, I examine the math and implement idealized elastic collisions in a JavaScript physics simulation. This video supplements the Nature of Code book series in Chapter 6 which uses 3rd party physics libraries to handle collisions rather than a direct implementation.

jul 12, 2024

Elastic Collisions

Filter by Language

Pick a language to filter

Filter by Topic

pixels

It's Genuary 2024! Watch as I attempt to build a falling sand simulation in p5.js using a grid of pixels and simple rules.

Falling Sand

Let's make a slide puzzle in p5.js together! We'll be using images, nested loops, and arrays, and by the end of our journey, we'll have a fully playable game!

Slide Puzzle

In this video, I follow Mike Ash’s guide to Fluid Simulation and port Jos Stam’s "Real-Time Fluid Dynamics for Games" algorithm and code in Processing (Java).

Fluid Simulation

In this coding challenge, I implement a pixel-based “fire” algorithm using Processing (Java).

Fire Effect

In this coding challenge, I attempt to simulate 2D water ripples using Processing (Java).

2D Water Ripple

In this multi-part coding challenge, I demonstrate how to use a circle packing algorithm.

Circle Packing

In this coding challenge, I implement “Pixel Sorting” in Processing (Java). Using a “selection sort” algorithm, I sort the pixels of an image by brightness and hue.

Pixel Sorting in Processing