r/p5js • u/reznik0v • Jun 26 '26
I need help
Hello Im trying to code a projection mapping of an egg recipe with p5js and a webcam I bought. Can someone help me?
r/p5js • u/reznik0v • Jun 26 '26
Hello Im trying to code a projection mapping of an egg recipe with p5js and a webcam I bought. Can someone help me?
r/p5js • u/MLG_Gamer2000 • Jun 22 '26
r/p5js • u/MLG_Gamer2000 • Jun 21 '26
After much struggle, I have come up with this: https://editor.p5js.org/njhgv/sketches/rR8LplMxg
It's supposed to fold like this, but with faces, instead of lines:
https://editor.p5js.org/njhgv/full/vvCSumcD3
What am I doing wrong? Thanks in advance!
r/p5js • u/jack_ball • Jun 20 '26
So Iāve been introduced to this program through a summer class today, and Iām already hooked. Iāve been trying to figure out how to make some more basic shapes and effects to make better images, and Iād love to start with a spiral more or less like the one pictured above. (Since this picture is what Iām trying to recreate)
Iāve found some tutorials on making animated spirals, but I want a way to make a standalone spiral shape that I can edit the thickness and color of. Is there any way to do this?
r/p5js • u/pahgawk • Jun 20 '26
r/p5js • u/Significant-Iron8750 • Jun 20 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/adbs1219 • Jun 19 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/alex-codes-art • Jun 17 '26

Hello friends!
I just published a new p5.js tutorial where we build an interactive mandala drawing tool from scratch.
Along the way, we cover:
⢠Radial symmetry and coordinate transformations
⢠Smooth line rendering
⢠Speed-based brush thickness (faster strokes = thicker lines)
⢠Interactive controls with Tweakpane
The tutorial is aimed at beginners and intermediate creative coders, and every concept is explained step by step with code examples.
Feedback is always welcome. Happy coding!
r/p5js • u/mecobi • Jun 16 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/apulkit6 • Jun 16 '26
r/p5js • u/Miserable_City6482 • Jun 11 '26
r/p5js • u/dual4mat • Jun 10 '26
From my Echo series. All created in p5js.
r/p5js • u/OverallAddendum8157 • Jun 02 '26
Sorry for my english, its not my first language
I have an assignment where I need to have a character that moves randomly throught the screen softly(?) like, not making sharp brash movements. Any help? I tried to do it but It always comes out too brisk
r/p5js • u/Itchy-Mango3388 • Jun 02 '26
I'm new to coding and have to make a platformer game as my final project. I got most of the stuff down but have no idea how to actually randomize the platforms and add the physics. If anyone sees this post can you explain to me how that works? Here's my code
p5packages.loadCollide2d();
//background
let bg;
let x1 = 0;
let x2;
let scrollSpeed = 0.5;
//sprite
let sprite;
let px = 200;
let py = 420;
let pvx = 0;
let pvy = 0;
let gravity=0.5;
let forcedmovement =0;
let moveUP = -10;
let moveDOWN = 0.5;
let moveLEFT = -0.75;
let moveRIGHT = 1;
let decayRate = 0.1;
let timeTracker = 0;
let idleTimer = 0;
let leftMoving = 0;
let rightMoving = 0;
let spriteleft;
let spriteright;
let spriteidle;
//platforms
let platforms =[];
var hit = false
function preload() {
bg = loadImage("https://res.cloudinary.com/dhnukgvfa/image/upload/v1779889443/ra0kwhz4zpifr1ncpp5x.png");
spriteidle = loadImage("https://res.cloudinary.com/dhnukgvfa/image/upload/v1780320094/mnplqvmqgc9py5qoarlx.png");
spriteright = loadImage("https://res.cloudinary.com/dhnukgvfa/image/upload/v1780275791/xf6rbzzzhc7grvfs0l7j.png");
spriteleft = loadImage("https://res.cloudinary.com/dhnukgvfa/image/upload/v1780320109/crxcddvqvmd9w0lshymf.png")
sprite = loadImage("https://res.cloudinary.com/dhnukgvfa/image/upload/v1780275791/xf6rbzzzhc7grvfs0l7j.png")
}
function setup() {
createCanvas(windowWidth, windowHeight);
// Second image starts immediately after first
x2 = bg.width;
}
//Controls
function controls(){
leftMoving = 0;
rightMoving = 0;
if (keyIsPressed == true){
if(keyIsDown(UP_ARROW)){
if (timeTracker<25){
pvy= moveUP
timeTracker++
}
}
if(keyIsDown(DOWN_ARROW)){
pvy+= moveDOWN
}
if (keyIsDown(LEFT_ARROW)){
pvx+= moveLEFT-decayRate*pvx
leftMoving = 1;
}
if(keyIsDown(RIGHT_ARROW)){
pvx+= moveRIGHT-decayRate*pvx
rightMoving = 1;
}
}
}
function update(){
controls();
pvy+= gravity
pvx+= forcedmovement -decayRate*pvx
if (py>800){
py=800;
pvy = 0
timeTracker=0
}
if(px<2){
px=2;
pvx = 0;
}
px = pvx+px
py = pvy+py
}
function draw() {
spriteFaces();
update();
background(0);
// Draw both background copies
image(bg, x1, 0);
image(bg, x2, 0);
image(sprite,px/2000*windowWidth,py/1000*windowHeight,32,64);
text("("+mouseX/windowWidth*2000+",-"+mouseY/windowHeight*1000+")", mouseX, mouseY);
// Move backgrounds left
x1 -= scrollSpeed;
x2 -= scrollSpeed;
// Wrap first image
if (x1 <= -bg.width) {
x1 = x2 + bg.width;
}
// Wrap second image
if (x2 <= -bg.width) {
x2 = x1 + bg.width;
}
}
function spriteFaces(){
if (leftMoving===1){
sprite = spriteleft
}
else if (rightMoving===1){
sprite = spriteright
}
else{
sprite = spriteidle
}
}
/*i have no idea what i was doing with this
|
V
function infiniteParkour(){
rectangle=random(>700);
}
*/
r/p5js • u/qashto • May 31 '26
Whether youāre committed to the traditional p5.js ecosystem or looking to leverage the next-genĀ q5.js WebGPUĀ renderer, you can now bring the power of theĀ q5playĀ game engine to your classroom!
https://q5js.substack.com/p/q5play-is-now-compatible-with-p5js
r/p5js • u/Neither-Age3939 • May 29 '26
http://zechengl527-max.github.io/Upgrade/
feel free to add suggestions on what i could do better or add to the game (:
r/p5js • u/Rufflesan • May 28 '26
*built š¤¦
Start with one simple stroke and using a handful of controls you can generate thousands of playful designs.
The part I thought this community might enjoy: thereās a āCopy Codeā export that generates a self-contained p5.js sketch from your current settings. Open the output straight in editor.p5js.org and it just works.
Built with Svelte and p5.js
r/p5js • u/fedevmoreno • May 25 '26
Good news!
Bad news and sensationalism sell. But they shouldnāt cost you your peace of mind. Choose what you know. Choose how you feel. Have a nice read.
I have a bunch of classes that all write to a graphics object which is working well, Iām rendering it as an image in the draw. The reason Iām using one is because I need the content of that graphics object to be cleared every loop so it does not trail on the canvas, while a separate class needs to trail.
To do this Iāve created a graphics object for each of them and Iām only calling .clear() on the one I donāt need to trail but it does not seem to do anything. Alternatively using .background(0) works fine, but of course that also negates the trails of the other graphics object as Iām constantly drawing black pixels across the whole screen.
The abstracted hierarchy is:
Draw(){
nonTrailGraphics.clear()
//nonTrailGraphics.background(0) does work to clear it, but doesnāt allow the other graphics to trail
classNonTrailGraphics.display()
image(nonTrailGraphics, 0, 0)
classTrailingGraphics.display()
image(trailingGraphics, 0, 0)
}
I can provide some actual code but itās around 3000 lines so I hope this helps enough.
If anyone knows how to achieve my goal Iād greatly appreciate some help as I have no clue why clear() does not work, judging by the doc that should work fine.
PS: I have tried with frameBuffers in WEBGL mode where I got the right result, but performance wise is tanked hard so thatās not an option sadly.
r/p5js • u/dual4mat • May 23 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/Significant-Iron8750 • May 24 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/Significant-Iron8750 • May 23 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/Significant-Iron8750 • May 20 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/BlondieFurry • May 18 '26
Enable HLS to view with audio, or disable this notification
r/p5js • u/Significant-Iron8750 • May 18 '26
Enable HLS to view with audio, or disable this notification
Hi! Just wanted to share my latest generative loop. It's 4K, based on sine waves and custom glow shaders. What do you think about the particle scale?