Code edit (1 edits merged)
Please save this source code
User prompt
add a weight to each ball with the bigger being hevier
User prompt
remove the threshold that you added
Code edit (1 edits merged)
Please save this source code
User prompt
add a clause that enables or disables the delay on spawning balls
User prompt
remove the delay from spawning balls
User prompt
Add a threshold to balls movement to avoid micro movements
User prompt
when the ball upgrades the score gets bumped up for a frame and then goes back down, why is this. please provide a solution?
User prompt
when the ball upgrades the score gets bumped up for a frame and then goes back down, why is this. please provide a solution
User prompt
use the function that detect an upgrade to add score when it takes palce
User prompt
detect when an upgrade of balls takes place
Code edit (1 edits merged)
Please save this source code
User prompt
in the upgrade function also add point when upgrading
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'reduce')' in or related to this line: 'self.value = balls.reduce(function (score, ball) {' Line Number: 114
User prompt
reward the player for when they get balls to merge
User prompt
when 2 balls merge add their point value to the score
User prompt
add a detection for balls merging
User prompt
spawn balls on every mouse click
User prompt
remove the ball spawning cooldown so i can throw balls faster
User prompt
i cant see the countdown
User prompt
let he spawn balls every mouse click
User prompt
remove the ball spawning cooldown so i can throw balls faster
User prompt
remove the ball spawning cooldown so i can throw balls faster
User prompt
also add a count down in the middle of the screen with the gameovertimer
User prompt
remove the ball spawning cooldown so i can throw balls faster
===================================================================
--- original.js
+++ change.js
@@ -155,10 +155,8 @@
for (var j = i + 1; j < balls.length; j++) {
if (balls[i].intersects(balls[j]) && balls[i].type === balls[j].type) {
balls[i].upgrade(function (upgradedBall) {
console.log("Ball upgraded to type: " + upgradedBall.type);
- LK.setScore(LK.getScore() + 1);
- score.updateScore();
});
balls[j].destroy();
balls.splice(j, 1);
// Adjust index to continue checking without skipping a ball
@@ -235,8 +233,11 @@
});
if (objectAboveZero) {
startGameOverTimer();
}
+ // Ensure score is updated correctly after ball upgrade
+ // Ensure score is updated correctly after ball upgrade
+ // Ensure score is updated correctly after ball upgrade
score.updateScore();
// Check if any object is above y=0
var objectAboveZero = balls.some(function (ball) {
return ball.y < 0;