User prompt
make enemy2 randmon movement less shaky
User prompt
when various enemy2 are spawned, have them move randomly and not have the same movement
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'randomOffsetX')' in or related to this line: 'self.randomOffsetX = Math.random() * 100; // Random offset for X movement' Line Number: 1159
User prompt
when various enemy2 are spawned, have them move randomly and not have the same movement
User prompt
make sure boss3 asset and boss3bullet assets are used for boss annd bullets on level 3
User prompt
create a boss3 asset for boss3 level and also create boss3bullet
User prompt
use boss mirror image when it moves to the left
User prompt
make sure that if the player selects a powerup or closes the menu with the close button, either way, it will only always increase one in the level counter.
User prompt
flash screen white twice when boss is spawned
User prompt
play bossappear sound when boss is spawned
User prompt
reduce frequency of boss bullet
Code edit (1 edits merged)
Please save this source code
User prompt
when boss shoots bossbullet play bossbullet
Code edit (1 edits merged)
Please save this source code
User prompt
on tick check if backtound music is playing if not play
User prompt
on game start play backgroundmusic on loop
User prompt
when an enemy is hit by a herobullet play hit
User prompt
when an enemy is destroyed play boom
User prompt
when a herobullet is shot, play shoot
User prompt
make sure level is increased when a powerup is selected
User prompt
also increase level on powerup screen when a powerup is selected as well as when its closed
User prompt
each level should spanwn as many enemy2 after a waves as the level number. so level1 will spanw them by one, level 2 two, and so on
User prompt
also when all levels are complete and it is starting again from first level, make everything faster
User prompt
when all levels are complete, start agan from first level, but double the previous run hitpoins for enemies.
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'levelNumber')' in or related to this line: 'console.log("Current Level:", currentLevel.levelNumber);' Line Number: 791
===================================================================
--- original.js
+++ change.js
@@ -69,8 +69,41 @@
game.addChild(newBullet);
}
};
});
+var Boss3 = Container.expand(function () {
+ var self = Container.call(this);
+ var bossGraphics = self.attachAsset('boss3', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 2;
+ self.hitpoints = 20; // Higher hitpoints for the third boss
+ self.update = function () {
+ self.x += Math.sin(LK.ticks / 30) * 5; // Sideways movement
+ if (Math.sin(LK.ticks / 30) < 0) {
+ self.scale.x = -1; // Mirror image when moving left
+ } else {
+ self.scale.x = 1; // Normal image when moving right
+ }
+ self.y = Math.min(self.y + self.speed, 2732 * 0.4); // Move to the top 40% of the screen
+ if (LK.ticks % 120 < 60) {
+ self.scale.x += 0.001;
+ self.scale.y += 0.001;
+ } else {
+ self.scale.x -= 0.001;
+ self.scale.y -= 0.001;
+ }
+ if (LK.ticks % 90 == 0) {
+ LK.getSound('bossbullet').play(); // Play bossbullet sound when Boss3 shoots BossBullet3
+ var newBullet = new BossBullet3();
+ newBullet.x = self.x;
+ newBullet.y = self.y + self.height / 2;
+ bullets.push(newBullet);
+ game.addChild(newBullet);
+ }
+ };
+});
var BossBullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('bossbullet', {
anchorX: 0.5,
@@ -109,8 +142,27 @@
self.scale.y -= 0.001;
}
};
});
+var BossBullet3 = Container.expand(function () {
+ var self = Container.call(this);
+ var bulletGraphics = self.attachAsset('boss3bullet', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5;
+ self.update = function () {
+ self.y += self.speed;
+ self.rotation += 0.1; // Add rotation to the boss bullet
+ if (LK.ticks % 120 < 60) {
+ self.scale.x += 0.001;
+ self.scale.y += 0.001;
+ } else {
+ self.scale.x -= 0.001;
+ self.scale.y -= 0.001;
+ }
+ };
+});
// Bullet class
var Bullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('bullet', {
8-bit. cartoon. white star.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon 8 bit fairy dust. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cartoon, 8bit, fireball. Black border. Cicular.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon, 8 bit, shield. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8bit, cartoon, axe. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dark electric ball, 8bit, cartoon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8bit, cartoon, treasure chest frame. very big empty center. only a fine border of chest. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
shoot
Sound effect
boom
Sound effect
Hit
Sound effect
backgroundmusic
Sound effect
bossbullet
Sound effect
bossappear
Sound effect
hit
Sound effect
diamondcollect
Sound effect
hooray
Sound effect
nono
Sound effect
letsgo
Sound effect
death
Sound effect
yes
Sound effect