Code edit (1 edits merged)
Please save this source code
User prompt
add a conffeti animation and call it in gameResult if profit > 0
Code edit (13 edits merged)
Please save this source code
User prompt
after liquidate update balanceText and stocksNumber
Code edit (7 edits merged)
Please save this source code
User prompt
if profit is >0 set profitText color to green
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
add a function liquidate() to player object and call it in gameResult
Code edit (1 edits merged)
Please save this source code
User prompt
in the gameResult display a Text with the final balance
Code edit (8 edits merged)
Please save this source code
User prompt
when hasFinished call a gameResult function. in this function show a 'popup' asset at the center of the screen then call GameOver
Code edit (1 edits merged)
Please save this source code
User prompt
increase updateStockValueText call rate
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'replace')' in or related to this line: 'var currentValue = parseFloat(stockValueText.text.replace('$', '')) || 0;' Line Number: 418
User prompt
in updateStockValueText add an interpolation
Code edit (9 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: stockValueText is not defined' in or related to this line: 'stockValueText.alpha = 1;' Line Number: 579
User prompt
make the stockValueText update smooth
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
In the following code ensure that slideAmount is never 0 self.x -= slideAmount;
Code edit (8 edits merged)
Please save this source code
User prompt
dynamicSlideAdjustment Should depend on self.x and the limits (game.width * 0.25 and game.width * 0.75)
===================================================================
--- original.js
+++ change.js
@@ -124,8 +124,9 @@
self.liquidate = function () {
while (self.stocks > 0) {
self.sellStock(1);
}
+ updateBalanceDisplay();
};
self.buyStock = function (quantity) {
var price = stockValuesHistory[graphIndex];
var cost = price * quantity;
@@ -270,25 +271,24 @@
finalBalanceText.x = game.width / 2 - 500;
finalBalanceText.y = game.height / 2 - 900; // Position below the popup
// Add the final balance text to the game
game.addChild(finalBalanceText);
- var profitTextColor = profit > 0 ? '#00ff00' : '#ffffff';
- profitTextColor = profit < 0 ? '#ff0000' : '#ffffff';
+ var profitTextColor = profit > 0 ? '#00ff00' : profit < 0 ? '#ff0000' : '#ffffff';
var profitText = new Text2('$' + profit.toFixed(0), {
size: 200,
fill: profitTextColor,
anchorX: 0.5,
anchorY: 0.5
});
- profitText.x = game.width / 2 - 400;
+ profitText.x = game.width / 2 - 220;
profitText.y = game.height / 2 - 550; // Position below the popup
// Add the final balance text to the game
game.addChild(profitText);
LK.setTimeout(function () {
LK.showGameOver();
- }, 4000); // Delay GameOver to allow the popup to be seen
+ }, 3000); // Delay GameOver to allow the popup to be seen
}
-var debug = true;
+var debug = false;
var slideAmount = 6.5;
var slideAmountVertical = 0.10; // Reduced speed for smoother vertical movement
var moveSegmentsVertically = 0;
var verticalSlideThreshold = 500; // Define a global threshold for vertical sliding
A Technical dark background. Nothing just a gradiant of colors from black to dark blue. Theme : stock market. background
A modern clean empty rectangular button without borders. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
without shadow
a basic empty ui popup with a black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.