User prompt
add a new function rainbowAnimation where a rainbow asset is created at the center of the screen with w & h at 0 and alpha 1, then it grows until w=2048 & h =908. when reaching 1480 and alpha ==1 then alpha starts lowering slowly to reach 0 when w = 2048. then rainbow is destroyed
Code edit (5 edits merged)
Please save this source code
User prompt
when has lost, also play wreck sound
Code edit (1 edits merged)
Please save this source code
User prompt
hide the player when hasLost
Code edit (1 edits merged)
Please save this source code
User prompt
stop moving player and other objects when hasLost
Code edit (1 edits merged)
Please save this source code
User prompt
update hasLost when lives are <= 0
User prompt
add a global variable hasLost
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: lives is not defined' in or related to this line: 'if (!lives) {' Line Number: 786
Code edit (2 edits merged)
Please save this source code
User prompt
prevent all movements when no more lives
Code edit (1 edits merged)
Please save this source code
User prompt
replace LK.getSound('bgMusic') by the use of a global bgMusic declared like this var bgMusic = LK.getSound('bgMusic');
User prompt
cal loopBgMusic(); after first player move ;
Code edit (1 edits merged)
Please save this source code
User prompt
before LK.getSound('gameoverSound').play();, stop bgMusic
Code edit (1 edits merged)
Please save this source code
User prompt
when player lose, play gameoversound then call gameover after 3 sec
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: isPlaying is not defined' in or related to this line: 'if (isPlaying) {' Line Number: 851
Code edit (1 edits merged)
Please save this source code
User prompt
Play landing sound once when player lands after a jump
===================================================================
--- original.js
+++ change.js
@@ -695,8 +695,41 @@
/****
* Game Code
****/
+function rainbowAnimation() {
+ var rainbow = LK.getAsset('rainbow', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 0,
+ height: 0,
+ alpha: 1,
+ x: STAGE_WIDTH / 2,
+ y: STAGE_HEIGHT / 2
+ });
+ game.addChild(rainbow);
+ var maxWidth = 2048;
+ var maxHeight = 908;
+ var alphaDecreaseStartWidth = 1480;
+ var growthRate = 20;
+ var alphaDecreaseRate = 0.01;
+ var interval = LK.setInterval(function () {
+ if (rainbow.width < maxWidth) {
+ rainbow.width += growthRate;
+ rainbow.height += growthRate * (maxHeight / maxWidth);
+ if (rainbow.width >= alphaDecreaseStartWidth) {
+ rainbow.alpha -= alphaDecreaseRate;
+ }
+ if (rainbow.alpha <= 0) {
+ rainbow.destroy();
+ LK.clearInterval(interval);
+ }
+ } else {
+ rainbow.destroy();
+ LK.clearInterval(interval);
+ }
+ }, 16); // Approximately 60 FPS
+}
;
var STAGE_WIDTH = 2048;
var STAGE_HEIGHT = 2732;
var SCREEN_METERAGE = 1 / 150;
Pixel art heart icon . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
two vertical lines with a blank background.
single green firework explosion . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of a cute elf. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tileable green grass texture..
arbre chene.
cerisier avec des fleur. Pixel art.
pixel art of a large rock.
pixel art of a tree stump.
pixel art of a 4 leaf clover.
pixel art of a wooden board.
pixel art of a bush.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a 4 leaf orange clover... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a 4 leaf purple clover.... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a 4 leaf indigo clover.... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A start button for an elf game in a magic forest. Pixel art.