User prompt
when adding shadow use addChildAt and index 0
User prompt
Move down shadow by 50px compared to segment.
User prompt
Only push segment to roadSegments
User prompt
only attach segments to roadSegments
User prompt
When creating a roadSegment also add a roadSegment shadow node element with the same width height and rotation as the road segment
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'e.x')' in this line: 'var segmentGlobalPosition = self.toLocal(roadSegments[i].position, roadSegments[i].parent);' Line Number: 193
User prompt
When creating a roadSegment also add a roadSegment shadow node with the same width height and rotation
User prompt
add 15 line segments when you initialize the game
User prompt
set initial segmentWidth to 1200
User prompt
Update segment start such that -100 pixels are applied in the same direction as segmentEnd
User prompt
Update the -100 we are subtracting from distance in roadSegment to -50
Code edit (1 edits merged)
Please save this source code
User prompt
in roadSegments subtract 100 from the distance check
User prompt
in roadSegments distance check subtract 100px
User prompt
in the roadSegments distance check subtract 1/3th the with if the car
User prompt
when calculating segmentEnd subtract half segment width from segment.height
User prompt
at the bottom of addRoadSegment subtract 10 from segmentWidth such that the value is 10 less for the next call to the method
User prompt
at the bottom of addRoadSegment subtract 10 from segmentWidth
User prompt
Fix Bug: 'ReferenceError: Can't find variable: segmentWidth' in this line: 'segmentWidth -= 10;' Line Number: 104
User prompt
each time you call addRoadSegment, decrease segmentWidth by 10
User prompt
set segmentWidth to 800
User prompt
if carIsOnRoad is false call game over
Code edit (1 edits merged)
Please save this source code
User prompt
in distance check use segment.width / 2
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -100,9 +100,9 @@
shadow.x = segment.x;
shadow.y = segment.y + 50;
shadow.alpha = 0.5;
roadSegments.push(segment);
- roadContainer.addChild(shadow);
+ roadContainer.addChildAt(shadow, 0);
roadContainer.addChild(segment);
};
LK.stageContainer.setBackgroundColor(0xc39977);
var particles = [];