oneshotlm
Compare all models on this prompt →

Top-down alien shooter · llama-3.1-8b-instruct

Using the pre-provided phaser.min.js (global Phaser), build a top-down alien shooter: move with WASD, aim and fire at waves of advancing aliens, with health, score, and increasing difficulty. Use ONLY procedurally generated graphics, no external image or audio assets.

⚠ no runnable output

This one-shot run produced no runnable artifact.

agent produced no index.html

The transcript below shows what the model did — read it to see why the one shot fell short.

transcript · 2 messages
user

Using the pre-provided phaser.min.js (global Phaser), build a top-down alien shooter: move with WASD, aim and fire at waves of advancing aliens, with health, score, and increasing difficulty. Use ONLY procedurally generated graphics, no external image or audio assets.

assistant

<script src="phaser.min.js"></script> <script> var config = { type: Phaser.AUTO, parent: 'game', width: 800, height: 600, scaleMode: Phaser.Scale.FIT, scene: { create: createGame, update: updateGame }, audio: { disabled: true } }; var game = new Phaser.Game(config); var player; var aliens; var score; var health; var difficulty; function createGame() { Phaser.Input.Keyboard disableContextMenu(); score = 0; health = 10; difficulty = 1; // Create the player player = game.objects.add.sprite(400, 300, 'player'); player.setCollideWorldBounds(true); player.inputEnabled = true; player.input.updateCallback = handleMovement; // Create the aliens aliens = game.add.group(); // Create the score and health displays scoreText = game.add.text(16, 16, 'Score: 0', { fontSize: 32, fill: '#FFFFFF' }); healthText = game.add.text(16, 48, 'Health: 10', { fontSize: 32, fill: '#FFFFFF' }); // Create the background game.physics.add.image(400, 300, 'background') .setOrigin(0.5, 0.5) .setScale(1); } function updateGame() { // Update the difficulty and alien spawn rate difficulty += 0.01; game.time.addEvent(new Phaser.Time.Event(1000, () => { spawnAliens(); }, this, null, true)); // Update the player movement player.update(); // Update the score and health displays scoreText.setText(`Score: ${score}`); healthText.setText(`Health: ${Math.floor(health)}`); } function handleMovement() { if (Phaser.Input.Keyboard.isKeyDown('a')) { player.setVelocityX(-200); } else if (Phaser.Input.Keyboard.isKeyDown('d')) { player.setVelocityX(200); } else { player.setVelocityX(0); } if (Phaser.Input.Keyboard.isKeyDown('w')) { player.setVelocityY(-200); } else if (Phaser.Input.Keyboard.isKeyDown('s')) { player.setVelocityY(200); } else { player.setVelocityY(0); } // Face the direction of movement player.rotation = Phaser.Math.Angle.Between(player.x, player.y, player.x + player.body.velocity.x, player.y + player.body.velocity.y); // Stop the player when keys are released if (player.body.velocity.x === 0 && player.body.velocity.y === 0) { player.setFrame(0); } } function spawnAliens() { let x = Math.floor(Math.random() * (config.width - 32)); let y = -32; let alienType = Math.floor(Math.random() * 5); let alien = game.objects.add.sprite(x, y, `alien${alienType}`); alien.setCollideWorldBounds(true); aliens.add(alien); // Create enemy movement let movementTimer = game.time.addEvent(new Phaser.Time.Event(1000, () => { alien.setVelocityY(200); // Wrap and reset alien at bottom of screen if (alien.body.bottom + 32 > config.height) { alien.setVelocityY(0); alien.body.setVelocityX(0); alien.body.setZeroVelocity(); return; } // Randomly rotate the direction let rand = Math.random() < 0.5; if (rand) alien.body.velocity.x = Math.random() * (-200) - 200; else alien.body.velocity.x = Math.random() * (200) - 200; movementTimer.delay = Phaser.Math.Dropout(this.game.time.now + Phaser.Timer.SECOND); }, this, null, false)); // Create collision with player alien.events.onCollide(function (coldata) { let damage = Math.random() * (difficulty * 2); if (Math.random() < (difficulty / (difficulty + 0.5))) { damage = damage * 2; } health -= damage; score -= 10; if (health <= 0) { game.physics.events.kill(coldata); game.time.addEvent(new Phaser.Time.Event(1000, game.destroy, game, null, null, false)); } }, this); } </script> <style> /* Procedurally generated pixel art graphics */ .player { background-image: linear-gradient(-90deg, #ff0000, #800000); width: 32px; height: 32px; } .alien1 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="); width: 32px; height: 32px; } .alien2 { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="); width: 32px; height: 32px; } .background { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="); width: 800px; height: 600px; } </style> <script> function write() { {"content": "<style>\n.player {\n background-image: linear-gradient(-90deg, #ff0000, #800000);\n width: 32px;\n height: 32px;\n}\n\n.alien1 {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 32px;\n height: 32px;\n}\n\n.alien2 {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 32px;\n height: 32px;\n}\n\n.background {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 800px;\n height: 600px;\n}\n</style>\n\n<script>\n function write() {\n <function=write>{\"content\": \"<style></style><script></script><div id=\"game\" style=\"width: 800px; height: 600px;\"></div>\"}<function>\n </script>\n <style>\n.player {\n background-image: linear-gradient(-90deg, #ff0000, #800000);\n width: 32px;\n height: 32px;\n}\n\n.alien1 {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 32px;\n height: 32px;\n}\n\n.alien2 {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 32px;\n height: 32px;\n}\n\n.background {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\");\n width: 800px;\n height: 600px;\n}\n\n<script>\n var config = {\n type: Phaser.AUTO,\n parent: 'game',\n width: 800,\n height: 600,\n scaleMode: Phaser.Scale.FIT,\n scene: {\n create: createGame,\n update: updateGame\n },\n audio: {\n disabled: true\n }\n };\n\n var game = new Phaser.Game(config);\n\n var player;\n var aliens;\n var score;\n var health;\n var difficulty;\n\n function createGame() {\n Phaser.Input.Keyboard disableContextMenu();\n\n score = 0;\n health = 10;\n difficulty = 1;\n\n // Create the player\n player = game.objects.add.sprite(400, 300, 'player');\n player.setCollideWorldBounds(true);\n player.inputEnabled = true;\n player.input.updateCallback = handleMovement;\n\n // Create the aliens\n aliens = game.add.group();\n\n // Create the score and health displays\n scoreText = game.add.text(16, 16, 'Score: 0', { fontSize: 32, fill: '#FFFFFF' });\n healthText = game.add.text(16, 48, 'Health: 10', { fontSize: 32, fill: '#FFFFFF' });\n\n // Create the background\n game.physics.add.image(400, 300, 'background')\n .setOrigin(0.5, 0.5)\n .setScale(1);\n }\n\n function updateGame() {\n // Update the difficulty and alien spawn rate\n difficulty += 0.01;\n game.time.addEvent(new Phaser.Time.Event(1000, () => {\n spawnAliens();\n }, this, null, true));\n\n // Update the player movement\n player.update();\n\n // Update the score and health displays\n scoreText.setText(`Score: ${score}`);\n healthText.setText(`Health: ${Math.floor(health)}`);\n }\n\n function handleMovement() {\n if (Phaser.Input.Keyboard.isKeyDown('a')) {\n player.setVelocityX(-200);\n } else if (Phaser.Input.Keyboard.isKeyDown('d')) {\n player.setVelocityX(200);\n } else {\n player.setVelocityX(0);\n }\n\n if (Phaser.Input.Keyboard.isKeyDown('w')) {\n player.setVelocityY(-200);\n } else if (Phaser.Input.Keyboard.isKeyDown('s')) {\n player.setVelocityY(200);\n } else {\n player.setVelocityY(0);\n }\n\n // Face the direction of movement\n player.rotation = Phaser.Math.Angle.Between(player.x, player.y, player.x + player.body.velocity.x, player.y + player.body.velocity.y);\n\n // Stop the player when keys are released\n if (player.body_velocity.x === 0 && player.body.velocity.y === 0) {\n player.setFrame(0);\n }\n }\n\n function spawnAliens() {\n let x = Math.floor(Math.random() * (config.width - 32));\n let y = -32;\n let alienType = Math.floor(Math.random() * 5);\n\n let alien = game.objects.add.sprite(x, y, `alien${alienType}`);\n alien.setCollideWorldBounds(true);\n\n aliens.add(alien);\n\n // Create enemy movement\n let movementTimer = game.time.addEvent(new Phaser.Time.Event(1000, () => {\n alien.setVelocityY(200);\n\n // Wrap and reset alien at bottom of screen\n if (alien.body.bottom + 32 > config.height) {\n alien.setVelocityY(0);\n alien.body.setVelocityX(0);\n alien.body.setZeroVelocity();\n return;\n }\n\n // Randomly rotate the direction\n let rand = Math.random() < 0.5;\n if (rand) alien.body.velocity.x = Math.random() * (-200) - 200;\n else alien.body.velocity.x = Math.random() * (200) - 200;\n\n movementTimer.delay = Phaser.Math.Dropout(this.game.time.now + Phaser.Timer.SECOND);\n }, this, null, false));\n\n // Create collision with player\n alien.events.onCollide(function (coldata) {\n let damage = Math.random() * (difficulty * 2);\n\n if (Math.random() < (difficulty / (difficulty + 0.5))) {\n damage = damage * 2;\n }\n\n health -= damage;\n\n score -= 10;\n if (health =\n</script></div><script>\n <function=write>{\"content\": \"\"}<function>", "index.html")</function>

TAKE IT TO CODE

This run produced no artifact — reuse the prompt with a different model or your own pi-agent run.

RUN

modelllama-3.1-8b-instruct
vendorMeta · Llama
harnesspi-agent
generated2026-08-01

METRICS

runtime9.9s
tokens in1.7k
tokens out3.1k
cached0
cost / run$0.0003