Code edit (8 edits merged)
Please save this source code
User prompt
IN ``` for (var i = 0; i < puzzleManager.gridSize; i++) { for (var j = 0; j < puzzleManager.gridSize; j++) { var x = i * tileSize + gridBoard.x - gridBoard.width / 2 + tileSize / 2 + boardOffsetX; var y = j * tileSize + gridBoard.y - gridBoard.height / 2 + tileSize / 2 + boardOffsetY; var flower = new Flower(puzzleManager.currentLevel, x, y); flowers.push(flower); game.addChild(flower); } } ```` add another inner loop that goes from 0 to puzzleManager.currentLevel so that there are more flowers when we advance in levels
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: popSpeed1 is not defined' in or related to this line: 'flowerGraphics.scaleX += popSpeed1; // Adjust the increment for desired speed' Line Number: 85
Code edit (4 edits merged)
Please save this source code
User prompt
in Flower constructor play flowerPop sound with a random delay of 0 to 300ms
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in RatingStars, add 3 baseMobileTile. For better design place 1st at x = -400 and the 3rd at x=400
Code edit (1 edits merged)
Please save this source code
User prompt
add logs in calculateStarsScore
User prompt
enhance calculateStarsScore() function. if currentRoundMoves <= levelMinimalMoves[puzzleManager.currentLevel] return 3 if currentRoundMoves < levelMinimalMoves[puzzleManager.currentLevel]*0.66 return 2 else return 1
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
===================================================================
--- original.js
+++ change.js
@@ -1730,8 +1730,9 @@
var puzzleManager;
var isLogoAnimInFinished = false;
var isLogoAnimOutFinished = false;
var isRoundExitAnimFinished = false;
+var currentRoundMoves = 0;
// Initialize the game
initializeGame();
/****
* Helper Functions
@@ -2042,8 +2043,9 @@
}
function initNewRoundState() {
log("Entering New Round State...");
LK.getSound('levelStart').play();
+ currentRoundMoves = 0;
// Reset puzzle manager for new round
if (puzzleManager) {
puzzleManager.initPuzzle();
}
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