Code edit (1 edits merged)
Please save this source code
User prompt
wait for the computer fade out to complete before calling setSelectionPositions
Code edit (1 edits merged)
Please save this source code
User prompt
add a small delay before and after computer plays
User prompt
call setSelectionPositions before fading in
User prompt
bug Player not fading out when it's computer turn
User prompt
bug : player plays twice
User prompt
fix the players turns
Code edit (2 edits merged)
Please save this source code
User prompt
automate computer turn by animating his candy selection
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: candyCanes[0] is undefined' in this line: 'var minY = candyCanes[0].y + 120;' Line Number: 31
User prompt
update computeComputerCandiesCount to not depend on the player choices
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: candyCanes[0] is undefined' in this line: 'setSelectionPositions(self, candyCanes[0].y || 0);' Line Number: 179
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: candyCanes[0] is undefined' in this line: 'setSelectionPositions(self, candyCanes[0].y || 0);' Line Number: 177
User prompt
Fix Bug: 'TypeError: candyCanes[2] is undefined' in this line: 'var maxY = candyCanes[2].y + 140;' Line Number: 32
User prompt
This is a nim game with 13 sticks (12 candies + 1 last TNT). Players can take 1 to 3 sticks per turn. The objective is to let the other player take the last stick. Update the computeComputerCandiesCount to make him win
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: computeComputerCandiesCount is not defined' in this line: 'self.computerCandiesCount = computeComputerCandiesCount(candyCanes);' Line Number: 181
User prompt
add a function to compute computerCandiesCount. Call it when it's computer turn
Code edit (11 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: self.candyCanes is undefined' in this line: 'self.player.y = self.candyCanes[0].y + 120;' Line Number: 51
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -104,9 +104,9 @@
callback();
}
}
}, 1000 / 60);
- }, 500);
+ }, 1000);
};
self.createAsset('computerPlayer', 'Computer Player', .5, .5);
self.alpha = 0;
self.update = function () {};
@@ -208,9 +208,9 @@
console.log("Human Player's turn");
setSelectionPositions(self, candyCanes.length > 0 ? candyCanes[0].y : 0);
fade(self.player, 500, true);
self.computerCandiesCount = 0;
- }, 500);
+ }, 1000);
});
}
});
LK.on('tick', function () {
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