Code edit (1 edits merged)
Please save this source code
User prompt
in popupMultiplier, don't use scale, use width and height
Code edit (1 edits merged)
Please save this source code
User prompt
call popupMultiplier(value, x, y) at each bounce
Code edit (2 edits merged)
Please save this source code
User prompt
in popupMultiplier, popup the x2 asset at the position x,y. start at with,heigth 1x1 and make it grow until 1024x1024
User prompt
in popupMultiplier, check if value is in possibleValues, if not set it to 999;
Code edit (5 edits merged)
Please save this source code
User prompt
flash the ball at each bounce
User prompt
flash the screen at each bounce
Code edit (7 edits merged)
Please save this source code
User prompt
move the hoop after a shoot even if not scored
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
don't accept other touch while ball is moving
Code edit (5 edits merged)
Please save this source code
User prompt
reduce ball speed when launched
User prompt
reduce ball speed
Code edit (6 edits merged)
Please save this source code
User prompt
in LK.on('tick', ), after ball.update();, calculate distance between ball and hoop
Code edit (1 edits merged)
Please save this source code
User prompt
in initGame, if !isDebug, set alpha of hoopTriggers to 0
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: handleHoopBorder is not defined' in or related to this line: 'handleHoopBorder();' Line Number: 341
Code edit (3 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -38,36 +38,36 @@
self.speedX = Math.max(Math.min(self.speedX, maxSpeed), -maxSpeed); // Max speed limit
// Enhanced gravity effect with gradual vertical speed reduction and limit to max speed
self.speedY += self.gravityAcceleration;
self.speedY = Math.max(Math.min(self.speedY, maxSpeed), -maxSpeed); // Max speed limit
- // Left and right boundaries
- if (self.x <= 0 || self.x >= game.width) {
- self.speedX *= -1 * self.wallBounceSpeedRatio;
- bounceCounter += 1; // Increment bounce counter
- }
// Top boundary
if (self.y <= 0 + self.half) {
self.y = 0 + self.half;
self.speedY *= -1 * self.wallBounceSpeedRatio;
- bounceCounter += 1; // Increment bounce counter
+ LK.effects.flashScreen(0xffffff, 300); // Flash screen white for 300ms
+ bounceCounter = (bounceCounter || 1) * (bounceCounter + 1); // Increment bounce counter
// TODO : update bounce counter (x,y)
}
// Bottom boundary
if (ball.y > game.height - self.half) {
ball.y = game.height - self.half;
ball.speedY *= -1 * self.wallBounceSpeedRatio * self.floorBounceRatio;
- bounceCounter += 1; // Increment bounce counter
+ LK.effects.flashScreen(0xffffff, 300); // Flash screen white for 300ms
+ bounceCounter = (bounceCounter || 1) * (bounceCounter + 1); // Increment bounce counter
}
// Left boundary
if (ball.x < 0 + self.half) {
ball.x = 0 + self.half;
ball.speedX *= -1 * self.wallBounceSpeedRatio;
- bounceCounter += 1; // Increment bounce counter
+ LK.effects.flashScreen(0xffffff, 300); // Flash screen white for 300ms
+ bounceCounter = (bounceCounter || 1) * (bounceCounter + 1); // Increment bounce counter
}
+ // Right boundary
if (ball.x > game.width - self.half) {
ball.x = game.width - self.half;
ball.speedX *= -1 * self.wallBounceSpeedRatio;
- bounceCounter += 1; // Increment bounce counter
+ LK.effects.flashScreen(0xffffff, 300); // Flash screen white for 300ms
+ bounceCounter = (bounceCounter || 1) * (bounceCounter + 1); // Increment bounce counter
}
// Reset ball when in bottom and its speed is very low
if (ball.y > game.height * 0.6 && Math.abs(self.speedX) < 5 && Math.abs(self.speedY) < 5) {
self.reset();
@@ -211,14 +211,14 @@
var bounceCounter = 0;
var maxSpeed = 100;
var ballPassedAboveHoop = false;
var ballPassedInsideHoop = false;
-var timerSeconds = 600; // Set the initial timer value in seconds
+var timerSeconds = 60; // Set the initial timer value in seconds
var ball = null;
var hoop = null;
var score = 0;
var startPosition = null;
-var isDebug = true;
+var isDebug = false;
// UI
var background = null;
var scoreTxt = null;
var timerTxt = null;
@@ -355,9 +355,8 @@
confetti.y = 0;
LK.on('tick', function () {
confetti.animate(); // Animate confetti
});
- moveHoop();
/*
LK.setTimeout(function () {
isHandlingScore = false;
resetCollisionHandling();