Code edit (6 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: explosionGrahins is not defined' in this line: 'explosionGrahins.alpha = 0.5;' Line Number: 224
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: gameOverText is not defined' in this line: 'self.addChild(gameOverText);' Line Number: 205
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: gameOverText is not defined' in this line: 'gameOverText.anchor.set(0.5, 0);' Line Number: 204
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (var j = enemyShips.length - 1; j >= 0; j--) {' Line Number: 259
User prompt
when an enemy is destroyed, create an explosion effect using 30 instances of Explosion that radiate outwards
===================================================================
--- original.js
+++ change.js
@@ -219,15 +219,20 @@
});
var Explosion = Container.expand(function () {
var self = Container.call(this);
var explosionGraphics = self.createAsset('explosion', 'Explosion effect', 0.5, 0.5);
- explosionGraphics.tint = 0xD0021B;
- explosionGraphics.alpha = 0.5;
+ //explosionGraphics.tint = 0xFF6679;
+ explosionGraphics.alpha = 0.8;
var angle = Math.random() * Math.PI * 2;
var speed = Math.random() * 5 + 2;
self.move = function () {
this.x += Math.cos(angle) * speed;
this.y += Math.sin(angle) * speed;
+ if (explosionGraphics.alpha > 0) {
+ explosionGraphics.alpha -= 0.02;
+ } else {
+ self.destroy();
+ }
};
});
/****
@@ -353,8 +358,11 @@
enemyBullet.destroy();
}
currentScore += bossEnemyPoints;
scoreDisplay.updateScore(currentScore);
+ createExplosionAt(enemyBossShips[j].x, enemyBossShips[j].y);
+ createExplosionAt(enemyBossShips[j].x, enemyBossShips[j].y);
+ createExplosionAt(enemyBossShips[j].x, enemyBossShips[j].y);
enemyBossShips[j].destroy();
enemyBossShips.splice(j, 1);
if (enemyBossShips.length <= 0) {
currentLevel += 1;
a cute cool looking emoji face. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a cute looking heart. bright red.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
an evil looking emoji. purple and blue colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a shiny blue cute star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A start button. White on Red.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a grey touchpad. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a bright yellow shiny cute star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.