User prompt
make the coinflip animation smoother
User prompt
make it so when you either hit 2000$ or 100$, the game ends and a picture of an explosion filling the entire screen appears
User prompt
make it so you win or lose 200$ instead of 100$
User prompt
show the results of the coinflip when the animation is done
User prompt
make a rolling animation for the coin when clicking the 'button_heads' or 'button_tails'
User prompt
make a flipping animation for coin, when you click either of the buttons
User prompt
make it so if you hit 2000$ or 100$, the game ends
User prompt
make a counter for the money
User prompt
Fix Bug: 'TypeError: coinGraphics.setTexture is not a function' in this line: 'coinGraphics.setTexture(LK.getAsset('coin_' + result, 'Coin with ' + result + ' side up', 0.5, 0.5));' Line Number: 14
Initial prompt
Coinflip
===================================================================
--- original.js
+++ change.js
@@ -94,15 +94,16 @@
if (player.balance <= 100 || player.balance >= 2000) {
LK.showGameOver();
return;
}
- var win = coin.flip(choice);
- if (win) {
- player.updateBalance(100); // Win $100
- } else {
- player.updateBalance(-100); // Lose $100
- }
- updateBalanceText();
+ coin.flip(choice, function (win) {
+ if (win) {
+ player.updateBalance(100); // Win $100
+ } else {
+ player.updateBalance(-100); // Lose $100
+ }
+ updateBalanceText();
+ });
}
// Event listener for the Heads button
headsButton.on('down', function () {
handleFlipResult('heads');