User prompt
instead of `currentRoundMoves - levelMinimalMoves[puzzleManager.currentLevel];` create a new function: calculateStarsScore() that returns `3-currentRoundMoves - levelMinimalMoves[puzzleManager.currentLevel];`
Code edit (2 edits merged)
Please save this source code
User prompt
in animateRoundExit, spawn a RatingStar with parameter of (currentRoundMoves - levelMinimalMoves[puzzleManager.currentLevel]) at x = 2048+2048/2 then animate it to 2048/2
Code edit (1 edits merged)
Please save this source code
User prompt
after levelConfigs; at the end of the code; add a new global levelMinimalMoves that is an object with properties from 0 to 10; all properties will have the value 1
User prompt
add a new global, currentRoundMoves that count the number of moves player do duing the round. if will be set to 0 in initNewRoundState
User prompt
create a new class RatingStars. its constructor can take a integer parameter stars from 1 to 3. It will have a starsContainer. It will have 3 slots for star asset
Code edit (14 edits merged)
Please save this source code
User prompt
Please fix the bug: 'tween is not defined' in or related to this line: 'simpleTween(logo, {' Line Number: 2009 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Unable to load plugin: @upit/tween.v1' in or related to this line: 'var tween = LK.import("@upit/tween.v1");' Line Number: 45
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'tile.x += 2 * 2048;' Line Number: 2206
User prompt
Analyse precisely the animations in initNewRoundState, then create the equivalent animations in cleanPlayingState that make elements slide out to their x minus 2048 and after the end of the anim, set x to x + 2*2048 to be ready for next initNewRoundState anim
Code edit (1 edits merged)
Please save this source code
User prompt
in initNewRoundState, add 2048 to initial tiles x then animate their entrance like for gridboard
Code edit (10 edits merged)
Please save this source code
User prompt
in initNewRoundState, add 2048 to initial gridBOard x then animate its entrance like for backgroundImage2
User prompt
in initNewRoundState, create and animation of background slide to the left using backgroundImage1 and backgroundImage2
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
in cleanMenuState, animate the logo out to the left
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: tween is not defined' in or related to this line: 'tween(movingTile, {' Line Number: 1611 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (10 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -103,8 +103,11 @@
/****
* Game Code
****/
+function calculateStarsScore() {
+ return 3 - currentRoundMoves - levelMinimalMoves[puzzleManager.currentLevel];
+}
function assetExists(assetId) {
try {
LK.getAsset(assetId, {});
return true;
@@ -2205,9 +2208,9 @@
easing: tween.easeInOut,
onFinish: callBack
});
// Calculate the number of stars based on moves
- var stars = currentRoundMoves - levelMinimalMoves[puzzleManager.currentLevel];
+ var stars = calculateStarsScore();
// Create a new RatingStars instance
var ratingStars = new RatingStars(stars);
// Set initial position off-screen
ratingStars.x = 2048 + 2048 / 2;
straigth zenith view square light wooden pallet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
straigth zenith view square wooden pallet with big screws in each corner Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
simple yellow rating star. Modern video game style
tileSlide
Sound effect
levelWon
Sound effect
tileBlocked
Sound effect
fountain
Sound effect
waterInPipe
Sound effect
bgMusic
Music
logoBounce
Sound effect
levelStart
Sound effect
bgMusic2
Music
flowerPop
Sound effect
roundResult
Sound effect
gameWon
Sound effect
resetSound
Sound effect
birds
Sound effect
birds2
Sound effect
birds3
Sound effect