From 3131d58e58ca7991c764d74225468d5994ed91af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 19 Apr 2026 05:55:43 +0000 Subject: [PATCH] Remove pre-start animations for Space Invaders Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/7a2c3d4c-134f-4fb6-aeaa-9161764680a3 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com> --- src/assets/js/eggs.js | 13 +---- src/assets/js/games/space-invaders.js | 84 +-------------------------- 2 files changed, 3 insertions(+), 94 deletions(-) diff --git a/src/assets/js/eggs.js b/src/assets/js/eggs.js index 326f8abd..1bb30219 100644 --- a/src/assets/js/eggs.js +++ b/src/assets/js/eggs.js @@ -22,21 +22,10 @@ heartClickCount++; - // Visual feedback: heart grows with each click - const scaleAmount = 1 + heartClickCount * 0.3; - heart.style.transition = - "transform 0.1s cubic-bezier(0.17, 0.67, 0.83, 0.67)"; - heart.style.transform = `scale(${scaleAmount})`; - if (heartClickCount === 5) { phaserStarted = true; heart.innerHTML = "🎮"; - heart.style.transform = "scale(1.5)"; - - setTimeout(() => { - heart.style.opacity = "0"; - SpaceInvaders.launch(); - }, 300); + SpaceInvaders.launch(); } }); })(); diff --git a/src/assets/js/games/space-invaders.js b/src/assets/js/games/space-invaders.js index 2c8a2734..980248a1 100644 --- a/src/assets/js/games/space-invaders.js +++ b/src/assets/js/games/space-invaders.js @@ -9,41 +9,6 @@ */ const SpaceInvaders = (() => { - // ─── Emoji assets ──────────────────────────────────────────────────────── - - const BURST_EMOJIS = [ - "🎮", - "đŸ•šī¸", - "👾", - "🚀", - "✨", - "⭐", - "đŸ”Ĩ", - "đŸ’Ĩ", - "🌈", - "🎉", - "💖", - "💎", - "🤖", - "đŸ‘ģ", - "đŸĻ„", - "🍄", - "🌍", - "⚡", - "🏆", - "đŸŽ¯", - "🛸", - "đŸ‘Ŋ", - "👾", - "🐙", - "đŸĻ–", - "đŸĒ", - "🌌", - "🌠", - "â˜„ī¸", - "🌙", - ]; - const ALIEN_ROWS = ["👾", "đŸ‘Ŋ", "🛸", "🐙", "👾"]; const GAME_ID = "space-invaders"; @@ -70,7 +35,7 @@ const SpaceInvaders = (() => { width: "100vw", height: "100vh", zIndex: "10000", - pointerEvents: "none", // non-interactive until explosion is done + pointerEvents: "auto", }); document.body.appendChild(canvas); @@ -97,24 +62,7 @@ const SpaceInvaders = (() => { // ─── Scene callbacks ───────────────────────────────────────────────────── function _onCreate() { - const particles = _spawnExplosion(this); - - // After 5 s, fade out the explosion and start the real game - this.time.delayedCall(5000, () => { - this.tweens.add({ - targets: particles.getChildren(), - alpha: 0, - duration: 1000, - onComplete: () => { - particles.clear(true, true); - - const canvas = document.getElementById("game-canvas-" + GAME_ID); - if (canvas) canvas.style.pointerEvents = "auto"; - - _setupGame(this); - }, - }); - }); + _setupGame(this); } function _onUpdate() { @@ -135,34 +83,6 @@ const SpaceInvaders = (() => { // ─── Game setup ────────────────────────────────────────────────────────── - function _spawnExplosion(scene) { - const heartEl = document.getElementById("footer-heart"); - const rect = heartEl - ? heartEl.getBoundingClientRect() - : { left: window.innerWidth / 2, top: window.innerHeight - 60 }; - - const group = scene.add.group(); - - for (let i = 0; i < 40; i++) { - const emoji = Phaser.Utils.Array.GetRandom(BURST_EMOJIS); - const p = scene.add.text(rect.left, rect.top, emoji, { - fontSize: "32px", - }); - - scene.physics.add.existing(p); - p.body.setVelocity( - Phaser.Math.Between(-400, 400), - Phaser.Math.Between(-600, -1200), - ); - p.body.setBounce(0.6); - p.body.setCollideWorldBounds(true); - p.body.setAngularVelocity(Phaser.Math.Between(-200, 200)); - group.add(p); - } - - return group; - } - function _setupGame(scene) { // Player rocket scene.si_player = scene.add.text(