Code edit (7 edits merged)
Please save this source code
User prompt
remove the board
User prompt
when mouse is up, remove the selected candies
User prompt
don't select the 1st candy when mouse is not down
User prompt
start the selection process only when mouse is down
User prompt
when a candy is within the selected one make it a little bigger
User prompt
when a candy is within the selected one change its alpha
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: self.player is undefined' in this line: 'self.player.visible = playerTurn;' Line Number: 95
User prompt
remove duplicated code (player and computerPlayer instanciated twice)
Code edit (1 edits merged)
Please save this source code
User prompt
when playerTurn == true set computerPlayer alpha to 0
Code edit (1 edits merged)
Please save this source code
User prompt
update the number of selected cane when player moves : 1 when player y under (1st cane y + 100) 2 when player y under (2nd cane y + 100) 3 when player y under (3rd cane y + 100)
User prompt
add a gui text showing the current number of selected candies
User prompt
Fix Bug: 'ReferenceError: player is not defined' in this line: 'player.y = Math.max(minY, Math.min(maxY, pos.y));' Line Number: 132
User prompt
Fix Bug: 'ReferenceError: computerPlayer is not defined' in this line: 'computerPlayer.update();' Line Number: 125
User prompt
Fix Bug: 'TypeError: self.player is undefined' in this line: 'self.player.visible = playerTurn;' Line Number: 85
User prompt
Fix Bug: 'TypeError: player is undefined' in this line: 'player.visible = playerTurn;' Line Number: 85
User prompt
when playerTurn is true, show the player hide the computer asset; when playerTurn is false, hide the player asset and show the computer asset;
User prompt
add a variable playerTurn with value true
User prompt
limit the player y move from the first to the 3rd candy
User prompt
add the same shadows to the last candy cane
User prompt
create a separated asset and variable for the last stick
Code edit (6 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -91,9 +91,9 @@
selectedCandiesText.anchor.set(.5, 0);
LK.gui.topCenter.addChild(selectedCandiesText);
var playerTurn = true;
self.togglePlayerVisibility = function () {
- self.player.visible = playerTurn;
+ self.player.alpha = playerTurn ? 1 : 0;
self.computerPlayer.alpha = playerTurn ? 0 : 1;
};
self.computerPlayer = new ComputerPlayer();
self.computerPlayer.x = 1648;
@@ -160,6 +160,7 @@
}
self.selectedCandiesCount = 0;
var selectedCandiesText = LK.gui.topCenter.children[0];
selectedCandiesText.setText(self.selectedCandiesCount.toString());
+ self.togglePlayerVisibility();
});
});
a christmas wooden board Background image. High contrast. No shadows.
a vertical christmas wooden board with snow, and decorations on its sides Background image. High contrast. No shadows.
a photo-realistic white and red vertical candy stick slice Single Game Texture. No background. High contrast. No shadows.
a horizontal santa's arm with a white glove and the index pointing to the right Single Game Texture. No background. High contrast. No shadows.
an green hairy grinch's arm, pointing in the horizontal direction, the index finger pointing to the left Single Game Texture. No background. High contrast. No shadows.
a photo-realistic white and red twisted candy stick slice in vertical position and with an extinguished wick. At its center, a simple white rectangular "TNT" sticker in the same direction as the stick Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a top view of a TNT explosion fire Background image. High contrast. No shadows.
A funny Santa Claus disheveled and covered by black soot after an explosion. stary night. High contrast.
a futuristic white robot arm. horizontal direction. the index finger pointing to the left. Single Game Texture. No background. High contrast. No shadows.
A old super hero Santa Claus holding a candy cane in his hand High contrast.
frame of an empty christmas themed popup with a decorated border User interface
a single mat rounded empty button User interface