Free vibe code build from the Business Automation Mastermind

Build Geometry Dash with p5.js

Copy the code. Paste it. Play it. Then make it yours.

A fully working Geometry Dash clone built in p5.js. Spinning cube, physics, spikes, platforms, particle explosions, neon glow, and a progress bar. Paste the full code into the free p5.js editor and play in under 2 minutes. No install, no account, no tools. Then change the colors, the physics, and the level.

Runs in
editor.p5js.orgFree
Any browser
Scroll to get the full game code

ManyChat keyword: dashgame

Up and running in 2 minutes.

01

Copy the code

Hit the big gold button below. The entire game — physics, level design, particles, glow effects — copies to your clipboard.

02

Paste and play

Open editor.p5js.org, delete the starter code, paste, and click the Play button. Your Geometry Dash clone is running.

03

Customize everything

Change colors, jump height, gravity, speed, and add your own spikes and platforms. Every setting is labeled at the top of the file.

Want to learn how to do this?

Join the Business Automation Mastermind

A small, focused group of business owners who meet weekly to build real things, fast -- leaving more time to serve clients and be with the people you love.

Small group, capped at 15
We meet weekly
Idea to live build in one session
Learn More

Real reactions from Business Automation Mastermind members

What members said after their sessions.

Sophia

Sophia

Session 4

We have like 55 signups for our masterclass and we've only launched maybe four days ago.

Jenny

Jenny

Session 3

It took like 5 minutes! I just took the one which took me one year, and I said make an essence of that, and what would be the most interesting free webinar?

Alla

Alla

Session 3

It looks amazing, and everyone loves my website, and they can't believe that I've created it. I can't believe it myself.

SunDari

SunDari

Session 1

I used to pay all these people; now I can do it myself.

Ronnie

Ronnie

Session 2

I already had a draft website and it created a link to my calendar, a link to my link tree, a hyperlink for my WhatsApp, all the same photos. This is like 90% of the way there to the kind of website that I want.

Alla

Alla

Session 4

I've been comparing myself to a bird who now has wings. I feel so free.

Sophia

Sophia

Session 4

I was able to go in and create my full email marketing funnel. It took off so much of the work of creating the workflow.

Johanna

Johanna

Session 1

I have particles floating in the background, a circle following my cursor, things glowing. I could not believe I built this in one session.

Ronnie

Ronnie

Session 1

It pulled in my calendar link, my WhatsApp, all my deck photos. This is 90% of the website I wanted. In 45 minutes.

Aaqib

Aaqib

Session 2

I got a functional contact form on the website using Resend. I managed to get that set up in like 20 minutes. So I'm pretty stoked.

Pina Maria

Pina Maria

Session 4

I said change it and it changed my whole website in just one second. Everything worked, it was so easy.

Johanna

Johanna

Session 4

I was so on fire and so motivated because so many pieces of the puzzle I've been working on since a long time are coming together.

Jasmine

Jasmine

Session 2

It was great. It's been something that I really want to do, so I'm super grateful. It's so easy and we can just keep building over time. It's epic.

Aaqib

Aaqib

Session 3

I did a whole target audience and persona building exercise. I can safely say that I feel addicted to Claude.

Marina

Marina

Session 3

It's really empowering to learn and to see, with all these different tools, what becomes possible.

SunDari

SunDari

Session 4

Excited that I can just ask Claude anything and be guided and supported through it all.

Quincee

Quincee

Session 4

The website's looking great. I did a brand photoshoot this past week and I feel like a brand new person digitally.

Alla

Alla

Session 2

I got my website online. Thank you so much, it was amazing.

Quincee

Quincee

Session 4

I feel magnetic. I feel guided.

The Game Code

Copy. Paste. Play.

The full game code below. Go to editor.p5js.org, delete the starter code, paste this in, and click Play. Use SPACE or click to jump. The code is yours to change, break, and rebuild.

sketch.js — paste into editor.p5js.org
// ============================================================
// GEOMETRY DASH CLONE — Your Build
// Made with p5.js · Paste into editor.p5js.org to play!
// ============================================================

// =============================================
// CHANGE THESE TO CUSTOMIZE YOUR GAME
// =============================================

// How the game feels
const GRAVITY      = 0.70;   // higher = heavier (try 0.5 or 1.2)
const JUMP_FORCE   = -13.5;  // more negative = higher jump (try -18)
const PLAYER_SPEED = 6.5;    // starting speed (try 9 for speed run)
const MAX_FALL     = 15;     // how fast the cube falls

// Your cube
const CUBE_SIZE    = 38;
const GROUND_Y     = 400;    // where the ground is

// Colors — change any hex code to any color you want!
const CUBE_COLOR   = '#FFD700';  // your cube (gold)
const SPIKE_COLOR  = '#FF3300';  // spikes
const PLAT_COLOR   = '#2244DD';  // platforms
const BG_START     = '#0d0020';  // sky color at start (dark purple)
const BG_END       = '#001830';  // sky color at end (dark blue)

// =============================================
// LEVEL DESIGN — add your own obstacles here!
// =============================================
// spike:    { type: 'spike', x: 700 }
// double:   { type: 'double', x: 900 }
// platform: { type: 'platform', x: 1400, yOff: -115, w: 120 }
//   yOff = how high above ground (negative). w = width.

const LEVEL_DEFS = [
  { type: 'spike',    x: 650 },
  { type: 'spike',    x: 850 },
  { type: 'spike',    x: 1050 },
  { type: 'double',   x: 1250 },
  { type: 'platform', x: 1520, yOff: -115, w: 130 },
  { type: 'spike',    x: 1760 },
  { type: 'double',   x: 1950 },
  { type: 'spike',    x: 2150 },
  { type: 'spike',    x: 2230 },
  { type: 'spike',    x: 2310 },
  { type: 'double',   x: 2500 },
  { type: 'platform', x: 2750, yOff: -120, w: 110 },
  { type: 'double',   x: 2960 },
  { type: 'spike',    x: 3160 },
  { type: 'double',   x: 3310 },
  { type: 'spike',    x: 3470 },
  { type: 'double',   x: 3620 },
  { type: 'spike',    x: 3760 },
  { type: 'double',   x: 3900 },
];

const LEVEL_LENGTH = 4400;

// =============================================
// GAME ENGINE
// =============================================
let worldX = 0, player, particles = [], gameState = 'playing', attempts = 1, jumpHeld = false, obstacles;

function setup() {
  createCanvas(800, 480);
  frameRate(60);
  obstacles = buildObstacles();
  resetPlayer();
}

function resetPlayer() {
  player = { x: 150, y: GROUND_Y - CUBE_SIZE, vy: 0, onGround: true, rotation: 0 };
}

function draw() {
  drawBG();
  if (gameState === 'playing') {
    updatePlayer();
    checkCollisions();
    if (worldX >= LEVEL_LENGTH) gameState = 'win';
  }
  updateParticles();
  drawGround();
  drawAllObstacles();
  drawPlayer();
  drawParticles();
  drawHUD();
  if (gameState === 'dead') drawDeathScreen();
  if (gameState === 'win')  drawWinScreen();
}

function drawBG() {
  let t = constrain(worldX / LEVEL_LENGTH, 0, 1);
  let top = lerpColor(color(BG_START), color(BG_END), t);
  let bot = lerpColor(color('#000010'), color('#002244'), t);
  for (let y = 0; y < height; y++) {
    stroke(lerpColor(top, bot, map(y, 0, height, 0, 1)));
    line(0, y, width, y);
  }
  stroke(255, 255, 255, 14); strokeWeight(0.5);
  let gx = (-worldX % 60 + 60) % 60;
  for (let x = gx; x < width; x += 60) line(x, GROUND_Y, x, height);
  for (let y = GROUND_Y; y < height; y += 60) line(0, y, width, y);
  strokeWeight(1);
}

function drawGround() {
  noStroke(); fill(20, 20, 50);
  rect(0, GROUND_Y, width, height - GROUND_Y);
  drawingContext.shadowBlur = 14; drawingContext.shadowColor = '#5566FF';
  stroke('#5566FF'); strokeWeight(2);
  line(0, GROUND_Y, width, GROUND_Y);
  drawingContext.shadowBlur = 0; strokeWeight(1);
}

function updatePlayer() {
  player.vy += GRAVITY; player.vy = min(player.vy, MAX_FALL); player.y += player.vy;
  if (player.y >= GROUND_Y - CUBE_SIZE) {
    player.y = GROUND_Y - CUBE_SIZE; player.vy = 0; player.onGround = true;
    player.rotation = round(player.rotation / 90) * 90;
    if (jumpHeld) doJump();
  } else { player.onGround = false; }
  if (!player.onGround) player.rotation += 7;
  worldX += PLAYER_SPEED + map(worldX, 0, LEVEL_LENGTH, 0, 3.5);
}

function doJump() {
  if (player.onGround) { player.vy = JUMP_FORCE; player.onGround = false; }
}

function drawPlayer() {
  push();
  translate(player.x + CUBE_SIZE / 2, player.y + CUBE_SIZE / 2);
  rotate(radians(player.rotation));
  drawingContext.shadowBlur = 20; drawingContext.shadowColor = CUBE_COLOR;
  fill(CUBE_COLOR); noStroke(); rectMode(CENTER);
  rect(0, 0, CUBE_SIZE, CUBE_SIZE, 5);
  drawingContext.shadowBlur = 0; fill(255, 255, 255, 90);
  rect(0, 0, CUBE_SIZE * 0.52, CUBE_SIZE * 0.52, 2);
  fill(CUBE_COLOR); rotate(PI / 4);
  rect(0, 0, CUBE_SIZE * 0.2, CUBE_SIZE * 0.2);
  pop(); rectMode(CORNER); drawingContext.shadowBlur = 0;
}

function buildObstacles() {
  let list = [];
  for (let def of LEVEL_DEFS) {
    let sz = def.size || 55;
    if (def.type === 'spike')  list.push(makeSpike(def.x, sz, GROUND_Y));
    if (def.type === 'double') { list.push(makeSpike(def.x, sz, GROUND_Y)); list.push(makeSpike(def.x + sz + 2, sz, GROUND_Y)); }
    if (def.type === 'platform') {
      let w = def.w || 120, ph = 18, py = GROUND_Y + (def.yOff || -100) - ph;
      list.push({ type:'platform', wx:def.x, drawY:py, w, h:ph, hx:def.x, hy:py, hw:w, hh:ph });
    }
  }
  return list;
}

function makeSpike(wx, sz, baseY) {
  return { type:'spike', wx, drawY:baseY-sz, size:sz, hx:wx-sz/2+10, hy:baseY-sz+12, hw:sz-20, hh:sz-12 };
}

function drawAllObstacles() {
  for (let obs of obstacles) {
    let sx = obs.wx - worldX;
    if (sx < -120 || sx > width + 120) continue;
    if (obs.type === 'spike')    drawSpike(sx, obs.drawY, obs.size);
    if (obs.type === 'platform') drawPlatform(sx, obs.drawY, obs.w, obs.h);
  }
}

function drawSpike(cx, y, sz) {
  drawingContext.shadowBlur = 14; drawingContext.shadowColor = '#FF4400';
  fill(SPIKE_COLOR); stroke('#FF7700'); strokeWeight(1.5);
  triangle(cx, y, cx - sz/2, y + sz, cx + sz/2, y + sz);
  stroke(255, 180, 50, 160); strokeWeight(1);
  line(cx, y, cx - sz/2, y + sz);
  strokeWeight(1); drawingContext.shadowBlur = 0;
}

function drawPlatform(sx, y, w, h) {
  drawingContext.shadowBlur = 10; drawingContext.shadowColor = '#4466FF';
  fill(PLAT_COLOR); stroke('#5577FF'); strokeWeight(1.5);
  rect(sx, y, w, h, 3);
  stroke('#88AAFF'); strokeWeight(2);
  line(sx + 3, y + 2, sx + w - 3, y + 2);
  strokeWeight(1); drawingContext.shadowBlur = 0;
}

function checkCollisions() {
  let px = player.x + 5, py = player.y + 5, pw = CUBE_SIZE - 10, ph = CUBE_SIZE - 10;
  for (let obs of obstacles) {
    let osx = obs.hx - worldX;
    if (osx + obs.hw < 0 || osx > width) continue;
    if (!aabb(px, py, pw, ph, osx, obs.hy, obs.hw, obs.hh)) continue;
    if (obs.type === 'spike') { triggerDeath(); return; }
    if (obs.type === 'platform') {
      let prevBot = py + ph - player.vy;
      if (player.vy > 0 && prevBot <= obs.hy + 3) {
        player.y = obs.hy - CUBE_SIZE; player.vy = 0; player.onGround = true;
        player.rotation = round(player.rotation / 90) * 90;
        if (jumpHeld) doJump();
      } else { triggerDeath(); return; }
    }
  }
}

function aabb(ax, ay, aw, ah, bx, by, bw, bh) {
  return ax < bx+bw && ax+aw > bx && ay < by+bh && ay+ah > by;
}

function triggerDeath() {
  gameState = 'dead';
  let cx = player.x + CUBE_SIZE/2, cy = player.y + CUBE_SIZE/2;
  for (let i = 0; i < 30; i++) {
    let a = random(TWO_PI), spd = random(2.5, 11);
    particles.push({ x:cx, y:cy, vx:cos(a)*spd, vy:sin(a)*spd-random(1,5),
      life:255, size:random(3,10), shape:random()>0.5?'rect':'tri',
      rot:random(TWO_PI), rs:random(-0.3,0.3), col:random([CUBE_COLOR,'#FFFFFF','#FFB300']) });
  }
}

function updateParticles() {
  for (let i = particles.length-1; i>=0; i--) {
    let p = particles[i];
    p.vy += 0.4; p.x += p.vx; p.y += p.vy; p.rot += p.rs; p.life -= 5;
    if (p.life <= 0) particles.splice(i,1);
  }
}

function drawParticles() {
  noStroke();
  for (let p of particles) {
    push(); translate(p.x, p.y); rotate(p.rot);
    let c = color(p.col); fill(red(c), green(c), blue(c), p.life);
    if (p.shape === 'rect') { rectMode(CENTER); rect(0,0,p.size,p.size); }
    else triangle(0,-p.size,-p.size/2,p.size/2,p.size/2,p.size/2);
    pop();
  }
  rectMode(CORNER);
}

function drawHUD() {
  let prog = constrain(worldX / LEVEL_LENGTH, 0, 1);
  noStroke(); fill(0,0,0,100); rect(40,10,width-80,15,7);
  fill(lerpColor(color('#00FFCC'), color('#FFDD00'), prog));
  drawingContext.shadowBlur = 8; drawingContext.shadowColor = '#00FFCC';
  rect(40,10,(width-80)*prog,15,7);
  drawingContext.shadowBlur = 0;
  fill(255,255,255,200); noStroke(); textSize(11); textAlign(CENTER,CENTER);
  text(floor(prog*100)+'%', width/2, 17);
  textAlign(LEFT,TOP); fill(255,255,255,100); textSize(11);
  text('Attempt '+attempts, 8, 30);
}

function drawDeathScreen() {
  if (particles.length > 8) return;
  fill(0,0,0,165); noStroke(); rect(0,0,width,height);
  fill('#FF5555'); textSize(52); textAlign(CENTER,CENTER);
  text(floor(constrain(worldX/LEVEL_LENGTH,0,1)*100)+'%', width/2, height/2-45);
  fill(255,255,255,210); textSize(16);
  text('Click or press SPACE to try again', width/2, height/2+12);
  fill(255,255,255,70); textSize(11);
  text('Attempt '+attempts, width/2, height/2+42);
}

function drawWinScreen() {
  fill(0,0,0,170); noStroke(); rect(0,0,width,height);
  fill('#FFD700'); textSize(56); textAlign(CENTER,CENTER);
  text('100%', width/2, height/2-55);
  fill('#FFFFFF'); textSize(24); text('LEVEL COMPLETE', width/2, height/2+5);
  fill(255,255,255,140); textSize(14);
  text('Click or press SPACE to play again', width/2, height/2+48);
}

function keyPressed()  { if (key===' '||keyCode===UP_ARROW) { jumpHeld=true;  handleAction(); } }
function keyReleased() { if (key===' '||keyCode===UP_ARROW)   jumpHeld=false; }
function mousePressed()  { jumpHeld=true;  handleAction(); }
function mouseReleased() { jumpHeld=false; }
function touchStarted()  { jumpHeld=true;  handleAction(); return false; }
function touchEnded()    { jumpHeld=false; return false; }

function handleAction() {
  if (gameState==='playing') { doJump(); return; }
  if (gameState==='dead' && particles.length<=8) { restart(); return; }
  if (gameState==='win') { restart(); return; }
}

function restart() {
  attempts++; worldX=0; particles=[]; gameState='playing'; resetPlayer();
}

Zero dependencies. Works in any modern browser. No account required.

Coming from Instagram or ManyChat? The giveaway keyword is dashgame.

0

obstacles in the default level

0+

lines of code — all yours to change

0

installs, accounts, or tools needed

Vibe Code Guide

Step-by-step. Copy. Change. See what happens.

The best way to learn: change one thing, hit Play, see what it does. These steps take you from copy-paste to a custom level.

01

Open the p5.js editor and paste the code

Go to editor.p5js.org. You'll see some starter code in the left panel. Select all of it and delete it. Then paste the game code you copied. Click the Play button (the triangle at the top). You should hear the game start and see the cube running.

Where to go
https://editor.p5js.org

Controls: SPACE or click to jump. Hold to keep jumping when you land.

02

Change your cube color

Near the top of the code, find the CUBE_COLOR line. Replace the hex code with any color. Hit Stop, then Play to see the change.

Change this line
const CUBE_COLOR   = '#00FFFF';  // cyan cube
const CUBE_COLOR   = '#FF00FF';  // magenta cube
const CUBE_COLOR   = '#FF4444';  // red cube
const CUBE_COLOR   = '#00FF88';  // neon green cube

The cube also glows whatever color you pick. Change SPIKE_COLOR and BG_START the same way.

03

Change how the game feels

Try these physics tweaks. Change one at a time — that is how you learn what each one does.

Physics presets to try
// Moon Physics — floaty and slow
const GRAVITY      = 0.4;
const JUMP_FORCE   = -10;

// Tank Mode — heavy and fast fall
const GRAVITY      = 1.3;
const JUMP_FORCE   = -15;

// Speed Run — same physics, faster scroll
const PLAYER_SPEED = 9;

// Super Jump — jump almost off screen
const JUMP_FORCE   = -20;
04

Add your own obstacles

Find LEVEL_DEFS near the top. Add new lines using the formats below. The x value is how far from the start (higher = later in the level).

Obstacle formats — copy any of these
// Single spike — easiest to jump
{ type: 'spike',    x: 400 },

// Two spikes side by side — harder!
{ type: 'double',   x: 500 },

// Floating platform — jump on top
{ type: 'platform', x: 700, yOff: -110, w: 130 },
//                           ^height   ^width

// Big spike (size: controls spike size)
{ type: 'spike',    x: 600, size: 80 },

Add { type: 'spike', x: 300 } near the start to test it right away. Increase x to push it further into the level.

05

Take it further with AI

Once you have the basics working, paste this prompt into Claude Code or Codex to add new features. Describe what you want and AI will add the code.

Paste into Claude Code
I built a Geometry Dash clone in p5.js. Here is the full code:

[paste your code here]

Please add these features:
1. Stars in the background that scroll at half speed
   (parallax effect)
2. The cube changes color gradually as the level
   progresses (use lerpColor)
3. A screen shake effect when the player dies
4. A coin floating at x=1800 — collect it for +1 score
Keep all existing physics and level design the same.

Replace [paste your code here] with your actual code. AI will return a new version with the features added.

What is inside the code

Every system you can break, change, and rebuild.

GRAVITY

How fast the cube falls. Default 0.70. Try 0.5 for floaty Moon Physics. Try 1.2 for heavy tank mode.

JUMP_FORCE

How high the cube jumps. Default -13.5. More negative = higher. Try -18 for jumps that go halfway up the screen.

PLAYER_SPEED

How fast the level scrolls at the start. Default 6.5. Try 9 for a speed run. Try 4 to learn the level.

MAX_FALL

Terminal velocity — how fast the cube falls maximum. Raise it for snappier falls. Lower it for floatier feel.

CUBE_COLOR

Your cube's color. Default '#FFD700' (gold). Try '#00FFFF' for cyan, '#FF00FF' for purple, '#FF4444' for red.

SPIKE_COLOR

Spike color. Default '#FF3300' (orange-red). Try '#00FF88' for alien spikes, '#FFFFFF' for white ice spikes.

PLAT_COLOR

Platform color. Default '#2244DD' (blue). Platforms glow whatever color you set here.

BG_START

Sky color at the beginning of the level. Default '#0d0020' (deep purple). The sky transitions to BG_END as you progress.

BG_END

Sky color at the end of the level. Default '#001830' (dark blue). Change both to create completely different vibes.

spike

{ type: 'spike', x: 700 } — A single spike. x is how far from the start. Add more by copying this line with bigger x values.

double

{ type: 'double', x: 900 } — Two spikes side by side. Much harder to jump over. Space them at least 200 apart from other obstacles.

platform

{ type: 'platform', x: 1400, yOff: -115, w: 120 } — A floating platform. yOff controls height above ground (more negative = higher). w is the width.

P.S. This build started as a demo for Parker, a 12-year-old learning to code. If a kid can paste this, change the colors, and add his own spikes in 20 minutes, so can you. The hardest part is the first copy and paste.