Code edit (3 edits merged)
Please save this source code
User prompt
add code so that EnemyBossShip moves side to side
User prompt
Fix Bug: 'Timeout.tick error: bigEnemyPoints is not defined' in this line: 'if (currentScore >= (smallEnemyPoints * 10 + bigEnemyPoints) * currentLevel && !game.bossSpawned) {' Line Number: 193
Code edit (8 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'enemyBossShipBullets')' in this line: 'var enemyBullet = enemyBossShips[i].enemyBossShipBullets[k];' Line Number: 243
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'enemyBossShipBullets')' in this line: 'var enemyBullet = enemy.enemyBossShipBullets[k];' Line Number: 214
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'enemyBossShipBullets')' in this line: 'var enemyBullet = enemy.enemyBossShipBullets[k];' Line Number: 214
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: initialY is not defined' in this line: 'if (self.y <= initialY) {' Line Number: 108
Code edit (1 edits merged)
Please save this source code
User prompt
update EnemyBossBullet so it continues to move off the screen
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: initialY is not defined' in this line: 'var angle = Math.atan2(initialY - self.y, initialX - self.x);' Line Number: 106
User prompt
Fix Bug: 'ReferenceError: heroShipY is not defined' in this line: 'enemy.shoot(heroShip.x, heroShipY);' Line Number: 228
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (j = enemy.enemyBossBullets.length - 1; j >= 0; j--) {' Line Number: 228
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in this line: 'for (j = enemyBossShips.enemyBossBullets.length - 1; j >= 0; j--) {' Line Number: 228
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: player is not defined' in this line: 'enemy.shoot(player.X, player.Y);' Line Number: 223
Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'y')' in this line: 'if (bullet.y > game.height + bullet.height || bullet.x < -bullet.width || bullet.x > game.width + bullet.width) {' Line Number: 240
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'move')' in this line: 'bullet.move(heroShip.x, heroShip.y);' Line Number: 237
===================================================================
--- original.js
+++ change.js
@@ -104,9 +104,14 @@
self.initialY = 0;
self.move = function () {
var angle = Math.atan2(self.initialY - self.y, self.initialX - self.x);
self.x += Math.cos(angle) * self.speed;
- self.y += Math.sin(angle) * self.speed;
+ if (self.y <= initialY) {
+ self.y += Math.sin(angle) * self.speed;
+ } else {
+ self.y += self.speed;
+ }
+
// Continue moving off the screen
if (self.x < -self.width || self.x > game.width + self.width || self.y < -self.height || self.y > game.height + self.height) {
self.destroy();
}
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.