User prompt
instead of despawning the ufo after 15 seconds, start moving to the right after 15 seconds. despawn it once it has touched the right side of the screen.
User prompt
stop the ufo moving after it has reached x=1300
User prompt
make the ufo spawn after 20 seconds
User prompt
make the ufo move in from the right of the screen
User prompt
despawn the ufo after it has been spawned in for 15 seconds.
User prompt
delete the ufo after it has been spawned in for 15 seconds.
Code edit (1 edits merged)
Please save this source code
User prompt
after 15 sec despawn the ufo
User prompt
make the ufo despawn after 15 seconds
User prompt
spawn the ufo every 70 seconds, at y 200 and x=1300
User prompt
Fix Bug: 'ReferenceError: PowerUp is not defined' in this line: 'var newPowerUp = self.addChild(new PowerUp());' Line Number: 238
User prompt
spawn the ufo every minute, at y 200 and x=1300
User prompt
Fix Bug: 'Uncaught ReferenceError: Cloud is not defined' in this line: 'var cloud = self.addChild(new Cloud());' Line Number: 185
User prompt
make an ufo asset and a ufo beam asset
User prompt
destroy the thanks asset when it touches the left of the screen
User prompt
account for its width when destroying it at the end of the screen
User prompt
destroy the thanks asset when it reaches the end of the screen
User prompt
despawn the thanks messages when they get off screen
User prompt
show the thanks asset on top of chimneys when a present touched them. move the asset with the chimney. despawn it after the chimney despawns.
User prompt
create an thanks asset
User prompt
ensure that the `LK.setTimeout` function has a delay specified that allows the "Thanks" asset to be visible for a desired amount of time before being destroyed. For example, set a delay of 2000 milliseconds (2 seconds) to allow the "Thanks" asset to be visible for that duration before calling `self.destroy()`.
User prompt
display it above the chimneys (account for the height). move it with the chimney
User prompt
display the thanks asset above chimneys that have been filled with presents
User prompt
add an thanks asset
User prompt
alternate the spawning of the chimneys: 1-2-1-3-2-1-2-3 and then over again
===================================================================
--- original.js
+++ change.js
@@ -84,11 +84,19 @@
};
var santaSleighGraphics = self.createAsset('santaSleigh', 'Santa in sleigh', .5, .5);
self.targetX = self.x;
});
-var Thanks = Container.expand(function () {
+var Thanks = Container.expand(function (chimneyX, chimneyY) {
var self = Container.call(this);
var thanksGraphics = self.createAsset('thanks', 'Thanks Graphics', .5, .5);
+ self.x = chimneyX;
+ self.y = chimneyY - thanksGraphics.height;
+ self.show = function () {
+ LK.setTimeout(function () {
+ self.destroy();
+ }, 2000);
+ };
+ self.show();
});
var Cloud = Container.expand(function () {
var self = Container.call(this);
var cloudGraphics = self.createAsset('cloud', 'Cloud Graphics', .5, .5);
@@ -279,8 +287,9 @@
score++;
scoreTxt.setText(score);
chimney.touchedByGift = true;
LK.effects.flashScreen(0x00ff00, 500);
+ var thanks = self.addChild(new Thanks(chimney.x, chimney.y));
gift.destroy();
gifts.splice(i, 1);
chimneySpeed += 0.2;
spawnChimney();
chimney. pixelart. residential chimney. only chimney. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gift. pixelart. christmas. green and red. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
night sky. pixelart. seamless. clouds. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. christmas. santa in sleigh. from the side. flying. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
grinch. green monster. pixelart. only face. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. chistmas present. powerup. game art Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.