User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'destroy')' in or related to this line: 'enemies[j].destroy();' Line Number: 198
User prompt
enemy ships should dissaper with same time as destroy
User prompt
make it 0.2 second
User prompt
make it 0.5 second
User prompt
destroy asset should dissappear after 1 second
User prompt
everytime laser hits a target use destroy asset to destroy ship
User prompt
add stars on background using star asset
User prompt
add laser sound again
User prompt
add laser sound again
User prompt
add background using background asset
User prompt
player should only able to move right and left
User prompt
add laser shooting sound using the sound i add
Initial prompt
space ship advanture
===================================================================
--- original.js
+++ change.js
@@ -181,15 +181,21 @@
game.addChild(destroyEffect);
LK.setTimeout(function () {
destroyEffect.destroy();
}, 200);
- LK.setTimeout(function () {
- enemies[j].destroy();
- lasers.splice(i, 1);
- enemies.splice(j, 1);
- score++;
- scoreTxt.setText(score);
- }, 200);
+ (function (enemyIndex, laserIndex) {
+ LK.setTimeout(function () {
+ if (enemies[enemyIndex]) {
+ enemies[enemyIndex].destroy();
+ enemies.splice(enemyIndex, 1);
+ }
+ if (lasers[laserIndex]) {
+ lasers.splice(laserIndex, 1);
+ }
+ score++;
+ scoreTxt.setText(score);
+ }, 200);
+ })(j, i);
break;
}
}
}
star white. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
enemy space ship boss it should be big and looking from top. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
explosion. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
linear laser red horizontal. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red pixel circle with black background and hearth on middle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
red circle with black background and bullet on middle next to x2 symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.