User prompt
can you set the hero bullet to 20
User prompt
it's not working what you tried please redo the optimization another way that checks the height of each row individually for optimization in a better way and remove the pools
User prompt
try to do your best to fix the lag i think it has to do with either projectiles or enemies
User prompt
Fix Bug: 'ReferenceError: heroBulletsPool is not defined' in this line: 'if (heroBulletsPool.length > 0) {' Line Number: 111
User prompt
Fix Bug: 'ReferenceError: asteroidsPool is not defined' in this line: 'if (asteroidsPool.length > 0) {' Line Number: 139
User prompt
Fix Bug: 'ReferenceError: enemiesPool is not defined' in this line: 'if (enemiesPool.length > 0) {' Line Number: 125
User prompt
can you please try to fix the lag for some reason it just starts lagging
User prompt
you removed the ability to shoot the hero bullet please add that back but keep mouse hover
User prompt
can you remove the dragnode in spaceship movement so that it moves while mouse is hovered over the screen to left and right
User prompt
i meant keep it on the bottom for the spaceship but allow it to always follow the mouse left and right
User prompt
nvm keep it at 500 for the explosion and make the spaceship move with the mouse instead teleporting
User prompt
make the explosion 100 instead of 500
User prompt
can you make the score update instantly for the enemy in the top left
User prompt
make the explosion more instant, also fix the score so it goes below the fps counter it's layered over it
User prompt
add a score system that places over each enemy that gets killed which logs your score the the top left under the fps system and links to the enemies, increase the score by 10 each enemy killed
User prompt
the bullets still cause lag can you please try to fix that if the enemies get lower
User prompt
attempt to fix the lag please when projectiles are shot in a row and hit multiple enemies
User prompt
remove explosion asset keep explosion animation and fix it so it places over the enemy when it dies also the enemies seem to delay dying now
User prompt
ok make them look like they explode an entirely different way with the explosion asset please
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'destroy')' in this line: 'enemies[n].destroy();' Line Number: 153
User prompt
try attaching the explosion to the enemy properly so when they get destroyed by the bullet it uses the explosion particle after then destroys itself also
User prompt
can you fix it so the enemies get hit by the projectile properly
User prompt
can you add explosion here as an asset please
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'height')' in this line: 'var height = enemies[n][0].height / 2;' Line Number: 146
User prompt
for (var n = 0; n < enemies.length; n++) { int height = enemies[n][0].height/2; if (enemies[n].length > 0 && heroBullets[i].y >= enemies[n][0].y - height && heroBullets[i].y <= enemies[n][0].y + height) { for (var j = 0; j < enemies[n].length; j++) { if (heroBullets[i].intersects(enemies[n][j])) { var explosion = new Explosion(); explosion.x = enemies[n][j].x; explosion.y = enemies[n][j].y; self.addChild(explosion); explosion.start(); enemies[n][j].destroy(); enemies[n].splice(j, 1); heroBullets[i].destroy(); heroBullets.splice(i, 1); break; } } } } replace this please
===================================================================
--- original.js
+++ change.js
@@ -118,8 +118,14 @@
bullet.y = hero.y;
self.addChild(bullet);
heroBullets.push(bullet);
});
+ for (var i = heroBullets.length - 1; i >= 0; i--) {
+ if (heroBullets[i].y < 0) {
+ heroBullets[i].destroy();
+ heroBullets.splice(i, 1);
+ }
+ }
var enemySpawnTimer = 0;
var asteroidSpawnTimer = 0;
LK.on('tick', function () {
if (enemySpawnTimer++ % 100 == 0) {
@@ -135,8 +141,14 @@
self.addChild(enemy);
enemies.push(enemy);
}
}
+ for (var i = enemies.length - 1; i >= 0; i--) {
+ if (enemies[i].y > 2732) {
+ enemies[i].destroy();
+ enemies.splice(i, 1);
+ }
+ }
if (asteroidSpawnTimer++ % 50 == 0) {
var asteroid;
if (asteroidsPool.length > 0) {
asteroid = asteroidsPool.pop();
enemy space ship Single Game Texture. In-Game asset. 2d. Transparent background. High contrast. No shadows.
asteroid Single Game Texture. In-Game asset. 2d. Transparent background. High contrast. No shadows.
plasma ball Single Game Texture. In-Game asset. 2d. Transparent background. High contrast. No shadows.
explosion particle Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
space ship facing upwards Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.