Code edit (6 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: undefined' in or related to this line: 'LK.setTimeout(scaleDown, 200);' Line Number: 2133
Code edit (1 edits merged)
Please save this source code
User prompt
give the confetti particle upward floating with an upward floating gravity
User prompt
The confetti particles should have upward gravity.
User prompt
Make the confetti float upwards.
===================================================================
--- original.js
+++ change.js
@@ -1212,8 +1212,10 @@
anchorY: 0.5
});
self.init = function (x, y, angle, speed, color) {
particleGraphics.tint = color;
+ particleGraphics.scale.set(.5 + Math.random() * 1);
+ particleGraphics.rotation = Math.PI * 2 * Math.random();
self.x = x;
self.y = y;
self.angle = angle;
self.speed = speed;
@@ -2041,9 +2043,9 @@
} else if (countdownValue === 0) {
var triggerFirework = function triggerFirework(fireworkDelay) {
LK.setTimeout(function () {
var x = -300 + Math.random() * 600;
- var y = -300 + Math.random() * 600;
+ var y = -500 + Math.random() * 1000;
var colors = [0xFFFFFF, 0xFF0000, 0x00FF00, 0xddddFF, 0xFFFF00, 0xFF00FF];
var color = colors[Math.floor(Math.random() * colors.length)];
var fireworkEffect = new FireworkEffect(x, y, 50, color);
LK.gui.center.addChild(fireworkEffect);
@@ -2068,16 +2070,16 @@
strokeColor: '#ff0000',
strokeThickness: 14
});
// Trigger firework effects at various places on the screen
- for (var i = 0; i < 10; i++) {
+ for (var i = 0; i < 16; i++) {
triggerFirework(i * 100 + Math.random() * 500);
}
spinHourglass();
// Bounce effect
- var scaleUpDuration = 2000; // Duration to scale up in milliseconds
+ var scaleUpDuration = 1200; // Duration to scale up in milliseconds
var scaleDownDuration = 200; // Duration to scale down in milliseconds
- var maxScale = 3.5; // Maximum scale factor
+ var maxScale = 2; // Maximum scale factor
var originalScale = 1; // Remember the original scale
var scaleUp = function scaleUp() {
var startTime = Date.now();
var scaleStep = function scaleStep() {
@@ -2092,9 +2094,9 @@
};
scaleStep();
};
var scaleDown = function scaleDown() {
- var fadeOutDuration = 1500; // Duration for the fade out in milliseconds
+ var fadeOutDuration = 1000; // Duration for the fade out in milliseconds
var startTime = Date.now();
var fadeStep = function fadeStep() {
var currentTime = Date.now();
var progress = Math.min(1, (currentTime - startTime) / fadeOutDuration);
@@ -2110,9 +2112,9 @@
}
};
fadeStep();
};
- LK.setTimeout(scaleDown, 500);
+ LK.setTimeout(scaleDown, 200);
scaleUp();
}
}, 1000); // Update countdown every second
game.timer = 120; // 2 minutes in seconds
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.
Cute toony red cool dragon in flight sideview. 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.
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.
Mystic cavern. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Chinese new years, magical landscape, year of the dragon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.