๐ค You
Create a procrastinating rocket. Light blue sky background with simple white clouds. Draw a rocket (triangle on top of rectangle, with fins) at bottom center on a launch pad. Show countdown timer: '10...9...8...' etc. But at random numbers, rocket displays excuse: 'Wait, did I leave the stove on?', 'Actually, space looks cold...', 'One more minute...', 'Is my insurance valid?'. Countdown resets after each excuse. Rocket never actually launches. Show 'Launch Attempts: X' counter. Comedy about procrastination. Under 50 lines.
๐ค AI
Hereโs a complete version that fits in **under 50 lines** for `sketch.js` and adds the missing p5.js include.
---
```html
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>p5.js Sketch</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- p5.js core library -->
<script src="https://cdn.jsdelivr.net/npm/p5@1.11.3/lib/p5.min.js"></script>
<script src="sketch.js"></script>
</body>
</html>
```
```js
// sketch.js
let count=10,lastTick=0,excuse='',showing=false,excuseStart=0,attempts=0;
const excuses=[
'Wait, did I leave the stove on?',
'Actually, space looks cold...',
'One more minute...',
'Is my insurance valid?'];
function setup(){
createCanvas(windowWidth,windowHeight);
textAlign(CENTER,CENTER);
textSize(32);
rectMode(CENTER);
}
function draw(){
background(150,200,255);
noStroke();fill(255);
for(let i=0;i<3;i++){
let cx=width*(0.2+0.3*i),cy=height*0.2+20*sin(frameCount*0.01+i);
ellipse(cx,cy,120,60);
ellipse(cx+40,cy+10,80,50);
ellipse(cx-40,cy+10,80,50);
}
let now=millis();
if(!showing&&now-lastTick>1000){
lastTick=now;
if(random()<0.25&&count<10) triggerExcuse();
else{
count--;
if(count<=0) triggerExcuse();
}
}
if(showing&&now-excuseStart>2500) showing=false;
drawRocket();
fill(0);
text('Countdown: '+count,width/2,50);
text('Launch Attempts: '+attempts,width/2,90);
if(showing) text(excuse,width/2,height*0.3);
}
function drawRocket(){
let rx=width/2,ry=height*0.75,bh=140,bw=50;
fill(200);rect(rx,ry,bw,bh);
fill(220,0,60);triangle(rx,ry-bh/2-40,rx-30,ry-bh/2,rx+30,ry-bh/2);
fill(255,120,0);
triangle(rx-bw/2,ry+bh/2,rx-bw,ry+bh/4,rx-bw,ry+bh/2+30);
triangle(rx+bw/2,ry+bh/2,rx+bw,ry+bh/4,rx+bw,ry+bh/2+30);
fill(80);rect(width/2,height*0.9,140,25);
rect(width/2,height*0.82,12,90);
}
function triggerExcuse(){showing=true;excuse=random(excuses);excuseStart=millis();attempts++;count=10;}
function windowResized(){resizeCanvas(windowWidth,windowHeight);}
```
```css
/* style.css (unchanged) */
body {
margin: 0;
padding: 0;
overflow: hidden;
}
canvas {
display: block;
}
```
Notes:
- `createCanvas` and friends come from p5.js: see [createCanvas](https://p5js.org/reference/#/p5/createCanvas).
- Timing uses [`millis()`](https://p5js.org/reference/#/p5/millis) to tick the countdown roughly once per second.
- At random countdown values (except the initial 10), `triggerExcuse()` shows a random excuse, increments โLaunch Attemptsโ, and resets back to 10, so the rocket never launches.