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
User prompt
the move of segments moveSegmentsLeft should be continous like the one of the indicator, currently their move is jerky !
Code edit (1 edits merged)
Please save this source code
User prompt
store a global array of segments. add them in drawSegment(). use them in moveSegmentsLeft to move them in place of `game.children.filter(function (child) {return child instanceof GraphSegment;})`
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: GraphSegment is not defined' in this line: 'return child instanceof GraphSegment;' Line Number: 219
User prompt
bug : in moveSegmentsLeft : var segments = game.children.filter(function (child) { return child.assetId === 'segment';}); returns 0 segments !
Code edit (4 edits merged)
Please save this source code
User prompt
bug : moveSegmentsLeft is called but the segments doesn't move to the left
Code edit (3 edits merged)
Please save this source code
User prompt
now when the a segment reaches the center (game.width / 2) make all the segments move to the left
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: nextX is not defined' in this line: 'console.log('ValueIndicator moving to next position: ' + stockValuesHistory[historyIndex], nextX, 1366 - targetY);' Line Number: 41
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: startGame is not defined' in this line: 'startGame();' Line Number: 252
User prompt
call startGame after 1 sec
Code edit (2 edits merged)
Please save this source code
User prompt
in drawSegment in updateWidth, with should only change when running is true
User prompt
add a global boolean "running". default false. The indicator and graph updates should occur only when running is true. Do not change anything else
Code edit (4 edits merged)
Please save this source code
User prompt
Fix ValueIndicator not moving after start
===================================================================
--- original.js
+++ change.js
@@ -187,9 +187,9 @@
var segment = gameRef.addChild(LK.getAsset('segment', 'Graph Segment', 0, 0.5));
segment.x = x1;
segment.y = y1;
segment.width = 1;
- segment.height = 10;
+ segment.height = 20;
var deltaX = x2 - x1;
var deltaY = y2 - y1;
var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
segment.rotation = Math.atan2(deltaY, deltaX);
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.