User prompt
it's still laggy try another way that doesn't involve a bullet pool to prevent lag
User prompt
can you add a way to disable lag from the bullets detecting collision without breaking the game
User prompt
i think the bullet pool being added broke the game
User prompt
Fix Bug: 'ReferenceError: bulletPool is not defined' in this line: 'var bullet = bulletPool.getBullet();' Line Number: 29
User prompt
try your best to render the game it's broken
User prompt
the game is broken can you fix it
User prompt
Fix Bug: 'ReferenceError: bulletPool is not defined' in this line: 'var bullet = bulletPool.getBullet();' Line Number: 29
User prompt
Fix Bug: 'ReferenceError: bulletPool is not defined' in this line: 'var bullet = bulletPool.getBullet();' Line Number: 29
User prompt
Fix Bug: 'ReferenceError: bulletPool is not defined' in this line: 'var bullet = bulletPool.getBullet();' Line Number: 29
User prompt
can you add some form of actual optimization to the game for bullets
User prompt
bullets cause lag at the moment can you fix that
User prompt
can you make only one row of enemies spawn at a time
User prompt
make the bullets collide with enemies and kill them
User prompt
add an ability to shoot at the enemy spaceship
User prompt
make only the enemy spaceship fixed so they sync up better with their movement going left and right
User prompt
enemies on the left side are going off the side of the screen can you make them more in sync
User prompt
add an ability for the enemies to go left and right, side to side from the screen while going down
User prompt
make the game end when the enemies are on the same level / height with the player
User prompt
make the enemies spread out into a formation and make them move down overtime row by row
User prompt
make the asteroids disappear when they go outside of the screen
User prompt
make them spawn overtime
User prompt
make new asteroids spawn on top of the screen
User prompt
make my Hero spaceship move with the ability to go left and right with my mouse, make the enemy space ships move randomly left, right, up, and down. make the asteroids spawn outside of the screen and fall down with random directions left or right.
Initial prompt
space shooter
===================================================================
--- original.js
+++ change.js
@@ -7,8 +7,11 @@
self.shoot = function () {
var bullet = new HeroBullet();
bullet.x = self.x;
bullet.y = self.y;
+ LK.setTimeout(function () {
+ bullet.destroy();
+ }, 1000);
return bullet;
};
});
var HeroBullet = Container.expand(function () {
@@ -99,25 +102,14 @@
asteroids.splice(i, 1);
}
}
for (var i = heroBullets.length - 1; i >= 0; i--) {
- if (heroBullets[i].isActive) {
- heroBullets[i].move();
- if (heroBullets[i].y < 0) {
- heroBullets[i].isActive = false;
- heroBullets[i].destroy();
- heroBullets.splice(i, 1);
- } else {
- for (var j = enemies.length - 1; j >= 0; j--) {
- if (heroBullets[i].intersects(enemies[j])) {
- enemies[j].destroy();
- enemies.splice(j, 1);
- heroBullets[i].isActive = false;
- heroBullets[i].destroy();
- heroBullets.splice(i, 1);
- break;
- }
- }
+ heroBullets[i].move();
+ for (var j = enemies.length - 1; j >= 0; j--) {
+ if (heroBullets[i].intersects(enemies[j])) {
+ enemies[j].destroy();
+ enemies.splice(j, 1);
+ break;
}
}
}
for (var i = 0; i < enemyBullets.length; i++) {
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.