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.5 s
- Cost
- $0.0025
- Output tokens
- 1,610
- Spent thinking
- 0 tokens
- Speed
- 386 tok/s
- Console errors
- 0
- First token after
- 369 ms
- First visible text after
- 369 ms
- Prompt tokens
- 363
- Code size
- 4.3 KB
- Finish reason
- stop
- Served by
- Model id
google/gemini-3.1-flash-lite- Reasoning sent
{"effort":"minimal"}- 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 · 135 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; justify-content: center; align-items: center; height: 100vh; overflow: hidden; }
#game-container { position: relative; width: 800px; max-width: 100%; height: 600px; border: 4px solid #e94560; background: #16213e; overflow: hidden; cursor: none; }
canvas { display: block; }
#ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; pointer-events: none; }
.msg { font-size: 2rem; text-shadow: 2px 2px 4px #000; background: rgba(0,0,0,0.5); padding: 20px; border-radius: 10px; }
</style>
</head>
<body>
<div id="game-container">
<canvas id="game"></canvas>
<div id="ui"><div class="msg" id="msg">Click to Start / Burger Smash!</div></div>
</div>
<script>
const canvas = document.getElementById('game');
const ctx = canvas.getContext('2d');
const msg = document.getElementById('msg');
canvas.width = 800;
canvas.height = 600;
let gameStarted = false;
let particles = [];
let bricks = [];
let ball = { x: 400, y: 500, dx: 5, dy: -5, r: 10 };
let paddle = { x: 350, w: 100, h: 30 };
let score = 0;
function initBricks() {
for(let r=0; r<5; r++) {
for(let c=0; c<10; c++) {
bricks.push({ x: 50 + c*70, y: 50 + r*40, w: 60, h: 20, active: true, color: `hsl(${r*60}, 70%, 60%)` });
}
}
}
function drawBurger() {
ctx.fillStyle = "#d35400";
ctx.fillRect(paddle.x, 560, paddle.w, 15); // Bottom bun
ctx.fillStyle = "#f1c40f";
ctx.fillRect(paddle.x+5, 555, paddle.w-10, 5); // Cheese
ctx.fillStyle = "#2ecc71";
ctx.fillRect(paddle.x+5, 550, paddle.w-10, 5); // Lettuce
ctx.fillStyle = "#8e44ad";
ctx.fillRect(paddle.x, 540, paddle.w, 10); // Meat
ctx.fillStyle = "#e67e22";
ctx.fillRect(paddle.x, 530, paddle.w, 10); // Top bun
}
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) {
paddle.x = ball.x - paddle.w/2;
return;
}
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 > 530 && ball.y < 560 && ball.x > paddle.x && ball.x < paddle.x + paddle.w) {
ball.dy = -Math.abs(ball.dy);
}
bricks.forEach(b => {
if(b.active && ball.x > b.x && ball.x < b.x+b.w && ball.y > b.y && ball.y < b.y+b.h) {
b.active = false;
ball.dy *= -1;
score += 10;
createExplosion(b.x + b.w/2, b.y + b.h/2, b.color);
}
});
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 => { if(b.active) { ctx.fillStyle = b.color; ctx.fillRect(b.x, b.y, b.w, b.h); }});
particles.forEach(p => {
ctx.fillStyle = p.color;
ctx.font = "15px Arial";
ctx.globalAlpha = p.life;
ctx.fillText("♥", p.x, p.y);
ctx.globalAlpha = 1.0;
});
requestAnimationFrame(() => { update(); draw(); });
}
canvas.addEventListener('mousemove', e => {
const rect = canvas.getBoundingClientRect();
paddle.x = e.clientX - rect.left - paddle.w/2;
});
window.addEventListener('mousedown', () => {
if(!gameStarted) {
gameStarted = true;
msg.style.display = 'none';
}
});
initBricks();
draw();
</script>
</body>
</html>