Top-down alien shooter · llama-4-scout
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.
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
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.
simple implementation of a top-down alien shooter using Phaser. ```html <script src="phaser.min.js"></script> <style> /* Add some basic styling to our game */ canvas { border: 1px solid black; } </style> <script> let game; let player; let []; let bullets = []; let score = 0; let health = 100; let wave = 1; let alienSpawnInterval; // Initialize the game function init() { game = new Phaser.Game({ type: Phaser.CANVAS, parent: 'game', width: 800, height: 600, scene: { preload: preload, create: create, update: update } }); } // Load assets (none in this case) function preload() {} // Create game objects function create() { // Create player player = game.add.rectangle(400, 300, 30, 30, 0xffffff); player.setCollideWorldBounds(true); game.add.text(10, 10, 'Health: ' + health, { fontSize24, fill: '#ffffff' }); game.add.text(10, 40, 'Score: ' + score, { fontSize: 24, fill: '#ffffff' }); game.add.text(10, 70, 'Wave: ' + wave, { fontSize: 24, fill: '#ffffff' }); // Start the game startGame(); } // Update game state function update(time, delta) { // Move player if (game.input.keyboard.isDown(Phaser.Input.Keyboard.W)) { player.y -= 5; } if (game.input.keyboard.isDown(Phaser.Input.Keyboard.S)) { player.y += 5; } if (game.input.keyboard.isDown(Phaser.Input.Keyboard.A)) { player.x -= 5; } if (game.input.keyboard.isDown(Phaser.Input.Keyboard.D)) { player.x += 5; } // Fire bullet if (game.input.activePointer.isDown) { let angle = Phaser.Math.Angle.BetweenPoints(player, game.input.activePointer.worldPosition); let bullet = game.add.rectangle(player.x, player.y, 5, 5, 0xffffff); bullet.angle = angle; bullets.push(bullet); } // Move bullets for (let i = bullets.length - 1; i >= 0; i--) { let bullet = bullets[i]; bullet.x += Math.cos(bullet.angle) * 5; bullet.y += Math.sin(bullet.angle) * 5; // Check collision with aliens for (let j = aliens.length - 1; j >= 0; j--) { let alien = aliens[j]; if (Phaser.Geom.Intersects.GetRectangleToRectangle(bullet.getBounds(), alien.getBounds())) { aliens.splice(j, 1); bullets.splice(i, 1); score++; game.children.getByName('scoreText').setText('Score: ' + score); ; } } // that are off screen if (!game.geom.Rectangle.ContainsPoint(new Phaser.Geom.Rectangle(0, 0, 800, 600), new Phaser.Geom.Point(bullet.x,))) { bullets.splice(i, 1); } } // Spawn aliens if (aliens.length < wave * 10 let alien = game.add.rectangle(Math * 800, 0, 30, 30, 0xff0000); aliens.push(alien); } // Move for (let i = 0; i < aliens.length; i++) { let alien = aliens[i]; alien.y += 2 // Check collision with player ifaser.Geom.Intersects.GetRectangleToRectangle(player.getBounds(), alien.getBounds())) { health -= 10; aliens.splice(i, 1); game.children.getByName('healthText').setText('Health: ' + health); if (health <= 0) { game.scene.stop(); } } // Remove aliens that are off screen if (alien.y > 600) { aliens.splice(i, 1); wave++; game.children.getByName('waveText').setText('Wave: ' + wave); } } } // Start the game function startGame() { // Create text objects for score, health and wave let healthText = game.add.text(10, 10, 'Health: ' + health, { fontSize: 24: '#ffffff' }); healthText.setName('healthText'); let scoreText = game.add.text(10, 40,: ' + score, { fontSize: 24, fill: '#ffffff' }); scoreText.setName('scoreText'); let waveText = game.add.text(10, 70, 'Wave: ' + wave, { fontSize: 24, fill: '#ffffff' }); waveText.setName('waveText'); // spawn interval alienSpawnInterval = game.time.addEvent({ delay: 1000, callback: spawnAliens, callbackScope: this, loop: true }); } // Spawn aliens at regular intervals function spawnAliens() { if (aliens.length < wave * 10) { let alien = game.add.rectangle(Math.random() * 800, 0, 30, 30, 0xff0000); aliens.push(alien); } } init(); </script> ```
TAKE IT TO CODE
This run produced no artifact — reuse the prompt with a different model or your own pi-agent run.