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
@@ -1315,18 +1315,34 @@
particle.angle = Math.random() * Math.PI * 2; // Random angle for direction
particle.speed = 1 + Math.random() * 2.5; // Adjusted speed for varied particle movement
particle.duration = 500 + Math.random() * 1000; // Keeping the duration dynamic
// Introduce gravity effect to some particles
- particle.gravity = Math.random() > 0.5 ? 0.01 : 0; // Half the particles have a gravity effect
+ for (var i = 0; i < 50; i++) {
+ var particle = self.attachAsset('glowEffect', {
+ x: x,
+ y: y,
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ particle.blendMode = 1;
+ particle.angle = Math.random() * Math.PI * 2; // Random angle for direction
+ particle.speed = 1 + Math.random() * 2.5; // Adjusted speed for varied particle movement
+ particle.duration = 500 + Math.random() * 1000; // Keeping the duration dynamic
+ particle.gravity = Math.random() > 0.5 ? 0.01 : 0; // Half the particles have a gravity effect
+ particle.targetScale = 0.5 + Math.random() * 1.5; // Varied scale for more visual variety
+ particle.scale.set(particle.targetScale * scaleMultiplier); // Initial scale set based on the random scale variable
+ particle.startTime = Date.now();
+ particle.rotationVelocity = -0.1 + Math.random() * .2;
+ particle.x += Math.cos(particle.angle) * Math.random() * 80;
+ particle.y += Math.sin(particle.angle) * Math.random() * 80;
+ _animateParticle(particle);
+ }
particle.targetScale = 0.5 + Math.random() * 1.5; // Varied scale for more visual variety
particle.scale.set(particle.targetScale * scaleMultiplier); // Initial scale set based on the random scale variable
particle.startTime = Date.now();
particle.rotationVelocity = -0.1 + Math.random() * .2;
particle.x += Math.cos(particle.angle) * Math.random() * 80;
particle.y += Math.sin(particle.angle) * Math.random() * 80;
- if (particle.gravity) {
- particle.y += particle.gravity * elapsedTime; // Apply gravity effect based on elapsed time
- }
_animateParticle(particle);
}
};
});
@@ -1475,16 +1491,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;
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.