Code edit (1 edits merged)
Please save this source code
User prompt
make the super boss do 50 damage
Code edit (1 edits merged)
Please save this source code
User prompt
make the super boss a seperate asset
User prompt
make a super boss that spawns in once score is at 100
User prompt
make boss enemies do twice as much damage
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in or related to this line: 'if (enemies[k].health > 0 && bullets[j].intersects(enemies[k])) {' Line Number: 275
User prompt
make a cap for the spawn interval
User prompt
set the text for score back to white
User prompt
make the text for score red
User prompt
make the text for score black
User prompt
make a score counter at the top that goes up 1 every time an enemy is killed and 10 every every time a boss is killed
User prompt
make enemies spawn in faster over time
User prompt
make enemies and bosses spawn less frequently
User prompt
have the background music always playing on a loop
User prompt
have a seperate sound for when the base gets hit
User prompt
make a sound when the boss gets hit
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'update')' in or related to this line: 'bullets[j].update();' Line Number: 250
User prompt
make the background the same size as the screen
User prompt
make a background
User prompt
make a background
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -106,14 +106,14 @@
var self = Container.call(this);
var healthBarGraphics = self.attachAsset('healthBar', {
anchorX: 0.5,
anchorY: 0.5,
- height: 10
+ height: 15
});
self.update = function () {
// Update logic for health bar
// Adjust width of health bar based on health of parent
- healthBarGraphics.width = self.parent.health * 2;
+ healthBarGraphics.width = self.parent.health;
};
self.interactive = false; // Disable hitbox for health bar
});
// Hero class
@@ -159,8 +159,14 @@
/****
* Game Code
****/
+var background = game.addChild(LK.getAsset('background', {
+ anchorX: 0.5,
+ anchorY: 0.5
+}));
+background.x = 2048 / 2;
+background.y = 2732 / 2;
LK.playMusic('backgroundMusic');
// Initialize hero
var hero = game.addChild(new Hero());
hero.x = 2048 / 2;