Hamburger breakoutOne-line
Gemini 3.1 Flash Lite
by GoogleReasoningClean
Running live in a sandboxed frame. Click inside it before using the keyboard.
How it went
- Total time
- 4.2 s
- Cost
- $0.0025
- Output tokens
- 1,595
- Spent thinking
- 0 tokens
- Speed
- 419.9 tok/s
- Console errors
- 0
- First token after
- 446 ms
- First visible text after
- 446 ms
- Prompt tokens
- 363
- Code size
- 4.4 KB
- Finish reason
- stop
- Served by
- Model id
google/gemini-3.1-flash-lite- Reasoning sent
model default- Max output
- 65,536 tokens
- Generated
- Nov 12, 2026
What it was asked
The prompt
“i want a breakout game where the paddle is a hamburger and every brick you break explodes into tons of little hearts”
System prompt, sent with every prompt
You are generating a self-contained web demo. It will be rendered automatically in a sandboxed iframe and compared side by side with the output of other AI models given the exact same task. Output rules: - Reply with exactly ONE fenced code block containing the complete file: ```html (or ```svg when the task asks for an SVG). No text before or after the code block. - Everything must be inline: CSS in <style>, JavaScript in <script>. No external files, images, fonts or network requests, except the CDN URLs explicitly allowed by the task. - Do not use localStorage, sessionStorage, cookies, IndexedDB, alert(), confirm(), prompt() or window.open(): they are blocked in the sandbox and will throw. - The page must look right in a 1280×800 viewport and adapt gracefully down to 375px wide. No horizontal scrollbar. - Something meaningful must be visible on first paint: a screenshot is taken automatically about 3 seconds after load, without any interaction. - Everything that makes the demo interesting must be visible within the first seconds: nothing hidden behind a high score, a later level or a long play session. - Games must start in a self-playing demo mode (a simple AI plays) behind a "Click or press a key to start" message, so the game can be judged in action without playing. - The iframe only receives keyboard events after the user clicks it: if the demo uses the keyboard, display a clear "Click or press a key to start" message. - The code must run with zero errors in the console of the latest Chrome.
Code run-1.html · 140 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Burger Breakout</title>
<style>
body { margin: 0; background: #1a1a2e; color: white; font-family: sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; overflow: hidden; }
canvas { border: 4px solid #e94560; background: #16213e; box-shadow: 0 0 20px rgba(233, 69, 96, 0.5); touch-action: none; cursor: none; }
#overlay { position: absolute; text-align: center; pointer-events: none; }
.hidden { display: none; }
</style>
</head>
<body>
<div id="overlay">
<h1>BURGER BREAKOUT</h1>
<p>Click to start!</p>
</div>
<canvas id="gameCanvas" width="800" height="600"></canvas>
<script>
const canvas = document.getElementById('gameCanvas');
const ctx = canvas.getContext('2d');
const overlay = document.getElementById('overlay');
let gameStarted = false;
let particles = [];
let bricks = [];
const paddle = { x: 350, y: 550, w: 100, h: 30 };
const ball = { x: 400, y: 500, dx: 5, dy: -5, r: 10 };
function initBricks() {
for(let r=0; r<5; r++) {
for(let c=0; c<10; c++) {
bricks.push({ x: 30 + c * 75, y: 30 + r * 40, w: 60, h: 20, color: `hsl(${r*40}, 70%, 60%)` });
}
}
}
function drawBurger() {
ctx.fillStyle = '#8B4513';
ctx.fillRect(paddle.x, paddle.y + 10, paddle.w, 15); // Bun bottom
ctx.fillStyle = '#FFD700';
ctx.fillRect(paddle.x + 5, paddle.y + 5, paddle.w - 10, 5); // Cheese
ctx.fillStyle = '#FF4500';
ctx.fillRect(paddle.x + 5, paddle.y, paddle.w - 10, 5); // Meat
ctx.fillStyle = '#8B4513';
ctx.beginPath();
ctx.arc(paddle.x + paddle.w/2, paddle.y, paddle.w/2, Math.PI, 0);
ctx.fill(); // Bun top
}
function createExplosion(x, y, color) {
for(let i=0; i<20; i++) {
particles.push({
x, y,
vx: (Math.random()-0.5)*10,
vy: (Math.random()-0.5)*10,
life: 1.0, color
});
}
}
function update() {
if (!gameStarted) {
ball.x = paddle.x + paddle.w / 2;
ball.y = paddle.y - 15;
} else {
ball.x += ball.dx;
ball.y += ball.dy;
if (ball.x < 0 || ball.x > 800) ball.dx *= -1;
if (ball.y < 0) ball.dy *= -1;
if (ball.y > 600) { gameStarted = false; ball.y = 500; }
// Paddle collision
if (ball.y + ball.r > paddle.y && ball.x > paddle.x && ball.x < paddle.x + paddle.w) {
ball.dy = -Math.abs(ball.dy);
}
// Brick collision
bricks.forEach((b, i) => {
if (ball.x > b.x && ball.x < b.x + b.w && ball.y > b.y && ball.y < b.y + b.h) {
ball.dy *= -1;
createExplosion(b.x + b.w/2, b.y + b.h/2, b.color);
bricks.splice(i, 1);
}
});
}
particles.forEach((p, i) => {
p.x += p.vx; p.y += p.vy; p.life -= 0.02;
if (p.life <= 0) particles.splice(i, 1);
});
}
function draw() {
ctx.clearRect(0, 0, 800, 600);
drawBurger();
ctx.fillStyle = 'white';
ctx.beginPath();
ctx.arc(ball.x, ball.y, ball.r, 0, Math.PI*2);
ctx.fill();
bricks.forEach(b => { ctx.fillStyle = b.color; ctx.fillRect(b.x, b.y, b.w, b.h); });
particles.forEach(p => {
ctx.fillStyle = `rgba(255, 0, 100, ${p.life})`;
ctx.font = "15px serif";
ctx.fillText("♥", p.x, p.y);
});
requestAnimationFrame(() => { update(); draw(); });
}
window.addEventListener('mousemove', e => {
const rect = canvas.getBoundingClientRect();
paddle.x = Math.max(0, Math.min(800 - paddle.w, e.clientX - rect.left - paddle.w/2));
});
window.addEventListener('mousedown', () => {
if (!gameStarted) {
gameStarted = true;
overlay.classList.add('hidden');
}
});
// Auto-player AI
setInterval(() => {
if (gameStarted) {
let target = ball.x - paddle.w / 2;
paddle.x += (target - paddle.x) * 0.15;
}
}, 16);
initBricks();
draw();
</script>
</body>
</html>