Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: availableBoonsTxt.anchor is undefined' in this line: 'availableBoonsTxt.anchor.set(.5, .5);' Line Number: 389
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: setting is not defined' in this line: 'if (setting.anchor) {' Line Number: 55
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: setting is not defined' in this line: 'text.anchor.set(settings.anchor.x, setting.anchor.y);' Line Number: 51
Code edit (4 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: countdownTxt.anchor is undefined' in this line: 'countdownTxt.anchor.set(.5, 0);' Line Number: 18
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: countdown is not defined' in this line: 'LK.gui.topCenter.addChild(countdown);' Line Number: 377
Code edit (19 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: this.children is undefined' in this line: 'LK.gui.topCenter.addChild(countdown);' Line Number: 377
User prompt
Fix Bug: 'TypeError: this.children is undefined' in this line: 'LK.gui.topCenter.addChild(countdown);' Line Number: 377
Code edit (1 edits merged)
Please save this source code
User prompt
in the cross weapon's launch function, create a new hero bullet in the direction from the hero to the hero's targetPos
User prompt
move the shootPos variable to the hero class, making sure to update all used references
User prompt
in the cross weapon class there's a `initialCooldown` variable set to 120, and a `cooldown` variable set to that. In the update function, reduce the cooldown by 1 until it reaches zero, at which point call a `launch` function and reset the `cooldown` back to the initial variable
User prompt
Fix Bug: 'TypeError: self.weapons[i].update is not a function' in this line: 'self.weapons[i].update();' Line Number: 141
User prompt
when the hero updates, update all weapons in the array
Code edit (1 edits merged)
Please save this source code
User prompt
when creating the hero's weapon, pass through the hero reference
Code edit (1 edits merged)
Please save this source code
User prompt
Rename the hero's `move` function to `update`
===================================================================
--- original.js
+++ change.js
@@ -320,19 +320,25 @@
}
var background = self.createAsset('boonBackground', 'Boon Selection Popup', 0.5, 0.5);
var boonMessageTitle = new BorderedText('Choose ' + count, {
size: 60,
- font: 'bold monospace'
+ font: 'bold monospace',
+ anchor: {
+ x: .5,
+ y: 0
+ }
});
background.y = 50;
- boonMessageTitle.anchor.set(.5, 0);
boonMessageTitle.y = -220;
self.addChild(boonMessageTitle);
var boonMessageSubtitle = new BorderedText(type + ' Boon', {
size: 50,
- font: 'bold monospace'
+ font: 'bold monospace',
+ anchor: {
+ y: .5,
+ y: 0
+ }
});
- boonMessageSubtitle.anchor.set(.5, 0);
boonMessageSubtitle.y = -160;
self.addChild(boonMessageSubtitle);
for (var i = 0; i < selectedBoons.length; i++) {
var boon = selectedBoons[i];
@@ -344,22 +350,28 @@
self.destroy();
callback(this.boon);
});
var boonLevel = new BorderedText(boons[boon], {
+ x: boonButton.x,
+ y: boonButton.y,
size: 50,
- font: 'bold monospace'
+ font: 'bold monospace',
+ anchor: {
+ x: .5,
+ y: .5
+ }
});
- boonLevel.anchor.set(.5, .5);
- boonLevel.y = boonButton.y;
- boonLevel.x = boonButton.x;
- self.addChild(boonLevel);
var boonName = new BorderedText(boon, {
+ x: boonButton.x + 60,
+ y: boonButton.y,
size: 50,
- font: 'bold monospace'
+ font: 'bold monospace',
+ anchor: {
+ x: 0,
+ y: .5
+ }
});
- boonName.anchor.set(0, .5);
- boonName.y = boonButton.y;
- boonName.x = boonButton.x + 60;
+ self.addChild(boonLevel);
self.addChild(boonName);
}
});
var Game = Container.expand(function () {
@@ -385,8 +397,9 @@
grass.height = 2732;
self.addChild(grass);
updateButton.x = -70;
updateButton.y = 70;
+ availableBoonsTxt.anchor.set(.5, .5);
availableBoonsTxt.x = -70;
availableBoonsTxt.y = 70;
updateButton.on('down', function () {
if (minorBoonCount + majorBoonCount > 0) {
pixel art cross with blue accents Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a pulsating white heart with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dark goo projectile with red highlights. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art tall blue fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an evil fantasy sword facing downward. Minor red details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundAmbient
Sound effect
heroHealed
Sound effect
pickupExperience
Sound effect
heroLeveled
Sound effect
weaponCrossImpact
Sound effect
heroImpact
Sound effect
enemyDeath
Sound effect
pickupWeapon
Sound effect
pickupCrucifix
Sound effect
weaponCrossLaunch
Sound effect
heroDeath
Sound effect
enemyRoar
Sound effect
clockChime
Sound effect