Code edit (5 edits merged)
Please save this source code
User prompt
in drawNextSegment update the points & delay calculation to take into account slideAmount when moveSegments is true
User prompt
in drawSegment update the width calculation to take into account slideAmount when moveSegments is true
User prompt
graphpoints x shoud never exeed game center
User prompt
graphPoints x should never exeed game center
User prompt
like for the indicator, segments (x+width) should never exeed the game center
User prompt
move var slideAmount = 4.0; to global scope
Code edit (1 edits merged)
Please save this source code
User prompt
updateSlide call is missinf
User prompt
segments are not sliding when moveSegments is true
Code edit (1 edits merged)
Please save this source code
User prompt
the slide() function of segments should be called in a tick loop
User prompt
remove moveSegmentsLeft() call
User prompt
in slide() function, only update position when moveSegments is true
User prompt
use moveSegments to control the slide of the GraphSegments
User prompt
when (segment.x + segment.width / 2 >= game.width / 2) also set moveSegments to true
User prompt
add a global boolean moveSegments defalting to false
User prompt
in moveSegmentsLeft, use the slide(à function instead of segment.x -= segment.width;
User prompt
add a slide() function in GraphSegment class that move the segment to the left
User prompt
in drawSegment use the GraphSegment class instead of a direct asset
User prompt
in the GraphSegment class add an asset like LK.getAsset('segment', 'Graph Segment', 0, 0.5)
User prompt
in moveSegmentsLeft use the global array of segments to move them
User prompt
store a global array of segments. add them in drawSegment()
User prompt
Fix Bug: 'TypeError: segment.slide is not a function' in this line: 'segment.slide();' Line Number: 189
User prompt
instead of moving the segments "externally" in moveSegmentsLeft, use a global boolean "moveSegments" defaulting to false. when `(segment.x + segment.width / 2 >= game.width / 2)` instead of calling moveSegmentsLeft, set moveSegments to true. Also add a slide() function in segments to make them move left when moveSegments is true
===================================================================
--- original.js
+++ change.js
@@ -161,9 +161,10 @@
y: y
});
// Compute the remaining coordinates
for (var i = 1; i < stockValuesHistory.length; i++) {
- x = Math.min(segmentWidth * i, game.width / 2);
+ //x = Math.min(segmentWidth * i, game.width / 2); // with limit
+ x = segmentWidth * i;
y = game.height / 2 - stockValuesHistory[i] * 10; // Scale the stock value for display
graphPoints.push({
x: x,
y: y
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.