User prompt
in the matching particle effect, make the gravity influence the particles movement
User prompt
Please fix the bug: 'Uncaught ReferenceError: gravity is not defined' in or related to this line: 'particle.y += gravity;' Line Number: 1360
Code edit (10 edits merged)
Please save this source code
User prompt
The particle effect on matching gems, give some of the particles a gravity effect
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.y = gemToRemove.y')' in or related to this line: 'self.y = gemToRemove.y; // Random y position within game bounds' Line Number: 1714
User prompt
Please fix the bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.y = gemToRemove.y')' in or related to this line: 'self.y = gemToRemove.y; // Random y position within game bounds' Line Number: 1713
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: Can't find variable: dragonGraphics' in or related to this line: 'dragonGraphics.scale.x *= -1; // Flip the dragon image on the horizontal axis if it comes from the right' Line Number: 1711
User prompt
Please fix the bug: 'Timeout.tick error: undefined is not an object (evaluating 'this.scale.x')' in or related to this line: 'this.scale.x *= -1; // Flip the dragon image on the horizontal axis if it comes from the right' Line Number: 1711
User prompt
Please fix the bug: 'Timeout.tick error: Can't find variable: dragonGraphics' in or related to this line: 'dragonGraphics.scale.x *= -1; // Flip the dragon image on the horizontal axis if it comes from the right' Line Number: 1711
User prompt
Please fix the bug: 'Timeout.tick error: dragon.flip is not a function. (In 'dragon.flip()', 'dragon.flip' is undefined)' in or related to this line: 'dragon.flip(); // Flip the dragon image if it comes from the right' Line Number: 1711
User prompt
Sometimes Dragon comes from the other side and it’s image is left on the horizontal axis
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -502,9 +502,9 @@
var snapped = self.snapToGrid(gemAbove.x, gemAbove.y + gemAbove.spacing * emptySpaces);
var newY = snapped.y;
// Animate the gem moving to the new position
gemAbove.alpha = 1;
- animateGemToPosition(gemAbove, gemAbove.x, newY);
+ animateGemToPosition(gemAbove, gemAbove.x, newY, (newY - gemAbove.y) * 1);
didFall = true;
break;
}
}
@@ -527,9 +527,9 @@
self.checkForMatches();
}, 250);
}
};
- function animateGemToPosition(gem, newX, newY) {
+ function animateGemToPosition(gem, newX, newY, delay) {
var fallDuration = 500; // Duration for the gem to fall to its new position
var bounceDuration = 300; // Duration for the bounce effect, slightly longer for realism
var scaleDuration = 150; // Duration for the scale effect after bouncing
var startTime = Date.now();
@@ -549,9 +549,9 @@
gem.isUsed = false;
}
}
};
- animateStep(); // Start the animation with the fall
+ LK.setTimeout(animateStep, delay); // Start the animation with the fall
}
this.handleGemMatched = function (gem) {
if (gem.color == goalGemType) {
matchedGemCount++;
@@ -1470,16 +1470,16 @@
/****
* Game Code
****/
+// Initialize a timer for showing hints
+// Initialize 2-minute timer
+// Initialize score
+// Initialize large countdown at the beginning of the game
+// Goal gem type and count
+// Dragon spawn timer
// SagaMap class
// SagaMap class
-// Dragon spawn timer
-// Goal gem type and count
-// Initialize large countdown at the beginning of the game
-// Initialize score
-// Initialize 2-minute timer
-// Initialize a timer for showing hints
var SagaMap = /*#__PURE__*/function (_Container) {
_inherits(SagaMap, _Container);
function SagaMap() {
var _this;
@@ -1668,17 +1668,10 @@
var randomIndex = Math.floor(Math.random() * board.gems.length);
var gemToRemove = board.gems[randomIndex];
if (gemToRemove) {
var dragon = new Dragon(gemToRemove);
- // Randomly decide the side from which the dragon will appear
- var fromLeft = Math.random() < 0.5;
- dragon.x = fromLeft ? -100 : 2048 + 100; // Start off-screen to the left or right based on fromLeft
- if (!fromLeft) {
- dragon.scale.x *= -1; // Flip the dragon image on the horizontal axis if it comes from the right
- }
- if (gemToRemove && typeof gemToRemove.y !== 'undefined') {
- self.y = gemToRemove.y; // Random y position within game bounds
- }
+ dragon.x = -100; // Ensure dragon starts off-screen to the left
+ dragon.y = gemToRemove.y; // Random y position within game bounds
game.addChild(dragon);
dragon.move();
}
}
a magical landscape of wonder and joy. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Magic, purple gem. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
glow. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Hourglass icon white. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Glow glare star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Shiny red envelope bao, chinese new years. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Magic greem gem in odd shape. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Flying unicorn fullbody sideview. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Magic Orange Gem. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Magic Blue Drop Shaped Gem. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
remove
Brilliant Gold Checkmark. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Magic diamond. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Enchanted forest. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Celestial reAlm. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Mystic cavern. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.