Uploaded February 2025 | Updated November 2026, 3 hours ago
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
--
Links:
π p5.js editor: editor.p5js.org
π A Shattered Heart Code: editor.p5js.org/pattvira/sketches/RwR7cL8Br
π Introduction to Creative Coding Playlist: youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn
Inspiration:
π Lea Naisbergβs Piece: instagram.com/p/DGDfaswtQba
References:
π matter.js: brm.io/matter-js
π matter.js playlist: youtube.com/playlist?list=PL0beHPVMklwgaLt1xHqlKNvPZ7nKjHnH3
Timestamps:
0:00 Intro
0:33 Set up the physics engine and create a single rectangular body
5:55 Add mouse for some interactivity
8:36 Create multiple rectangular bodies
12:42 Preload an image to sketch
14:40 Create a grid of cells and check which contains color values
20:33 Combine matter.js and image sketches
24:59 Create a Rect class
29:01 Add pixels information to each Rect object
33:19 Add background
33:35 Add boundaries
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
--
Links:
π p5.js editor: editor.p5js.org
π A Shattered Heart Code: editor.p5js.org/pattvira/sketches/RwR7cL8Br
π Introduction to Creative Coding Playlist: youtube.com/playlist?list=PL0beHPVMklwgMz4Z-mNp4_udo9mjBk7pn&si=XhvQaojd6cIrxvdn
Inspiration:
π Lea Naisbergβs Piece: instagram.com/p/DGDfaswtQba
References:
π matter.js: brm.io/matter-js
π matter.js playlist: youtube.com/playlist?list=PL0beHPVMklwgaLt1xHqlKNvPZ7nKjHnH3
Timestamps:
0:00 Intro
0:33 Set up the physics engine and create a single rectangular body
5:55 Add mouse for some interactivity
8:36 Create multiple rectangular bodies
12:42 Preload an image to sketch
14:40 Create a grid of cells and check which contains color values
20:33 Combine matter.js and image sketches
24:59 Create a Rect class
29:01 Add pixels information to each Rect object
33:19 Add background
33:35 Add boundaries










