User prompt
When adding new health, align all health in the middle of the screen
User prompt
when adding health, align them in the middle of the screen
User prompt
when adding health, align them in the middle of the screen
User prompt
make it possible to add more than 3 health
User prompt
make all changes smoother in all interactions
User prompt
when the chest interacts with the balls, add one health
User prompt
chest should not be born closer than 500 pixels to the edges of the screen
User prompt
Fix Bug: 'ReferenceError: chest is not defined' in or related to this line: 'if (LK.ticks % (10 * 60) === 0 && !chest.isVisible) {' Line Number: 364
User prompt
redo the appearance of the chest, it should interact with balls
User prompt
add one health when balls collide with chest
User prompt
add one health when balls collide with chest
User prompt
add one health when balls collide with chest
User prompt
add one health
User prompt
add one health each time the balls collide with a chest
User prompt
fix adding health and chest birth
User prompt
add one health when a chest collides with a ball or ball2
User prompt
add one health when a chest collides with a ball or ball2
User prompt
add one health when the chest interacts with a ball or ball2
User prompt
add one health when the chest interacts with a ball or ball2
User prompt
add one health when the chest interacts with a ball or ball2
User prompt
Fix Bug: 'TypeError: chest.checkCollisionWithBall is not a function' in or related to this line: 'chest.checkCollisionWithBall(ball);' Line Number: 296
User prompt
When a chest collides with a ball or ball2, the chest disappears from the screen and one health is added
User prompt
When a chest collides with a ball or ball2, the chest disappears from the screen and one health is added
User prompt
When a chest collides with a ball or ball2, the chest disappears from the screen and one health is added
User prompt
Fix Bug: 'ReferenceError: ball2 is not defined' in or related to this line: 'if (self.isVisible && (ball.intersects(self) || ball2.intersects(self))) {' Line Number: 151
===================================================================
--- original.js
+++ change.js
@@ -282,20 +282,8 @@
// Chest appearance logic
if (LK.ticks % (10 * 60) === 0 && !chest.isVisible) {
chest.showChest();
}
- // Chest collision with ball
- if (chest.isVisible && chest.intersects(ball)) {
- // Add one health if there is less than totalHealthIcons
- if (healthIcons.length < totalHealthIcons) {
- var newHealthIcon = game.addChild(new Health());
- newHealthIcon.setPosition(healthIcons.length, totalHealthIcons);
- healthIcons.push(newHealthIcon);
- }
- // Hide the chest after interaction
- chest.isVisible = false;
- chest.alpha = 0;
- }
// Cannonball collision with ball
var cannonballs = game.children.filter(function (child) {
return child instanceof Cannonball;
});
@@ -311,8 +299,18 @@
cannonball.destroy();
}
// Reset the ball
ball.reset();
+ } else if (chest.isVisible && chest.intersects(ball)) {
+ // Add one health if not at max health
+ if (healthIcons.length < totalHealthIcons) {
+ var newHealthIcon = game.addChild(new Health());
+ newHealthIcon.setPosition(healthIcons.length, totalHealthIcons);
+ healthIcons.push(newHealthIcon);
+ }
+ // Hide the chest
+ chest.isVisible = false;
+ chest.alpha = 0;
}
});
}); // Game tick event
LK.on('tick', function () {
ancient nautical chart. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
head of the wind god that blows wind on ancient maps, Middle Ages, black and white, wind from the mouth. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
scrub
pirate treasure chest. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
anchor. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cannonball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
explosion, black and white. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.