User prompt
When setting score text also update LK.setScore
User prompt
when decreasing segmentWidth decrease by 15
User prompt
when subtracting from segmentWidth set min to 350
Code edit (1 edits merged)
Please save this source code
User prompt
set score text drop shadow color to 373330
User prompt
use weight: not fontweight
User prompt
set score weight:800 and add a black drop shadow
User prompt
set the minimum road segment length to 1200
User prompt
when setting closestSegment, set a used property on the element and check for that so you can only get a point for approaching a segment once
User prompt
use a reference to the specific road segment rather than an index
User prompt
Score should update each time a new road segment is the closet segment
User prompt
Add score to the game
User prompt
move down shadow by 50px
User prompt
make the minimum segment length to 700
User prompt
before destroying a road segment first destroy it's shadow
User prompt
Fix Bug: 'ReferenceError: Can't find variable: shadow' in this line: 'roadContainer.addChildAt(shadow, 0);' Line Number: 104
User prompt
assign segment.shadow to shadow
User prompt
set shadow alpha to 1
===================================================================
--- original.js
+++ change.js
@@ -85,9 +85,9 @@
zigzag = !zigzag;
var segment = roadContainer.createAsset('roadSegment', 'Road Segment', 0.5, 0);
segment.width = segmentWidth;
segmentWidth -= 10;
- segment.height = i === 1 ? 3000 : Math.floor(Math.random() * (4000 - 700 + 1)) + 700;
+ segment.height = i === 1 ? 3000 : Math.floor(Math.random() * (4000 - 1200 + 1)) + 1200;
segment.rotation = zigzag ? -Math.PI - Math.PI / 4 : -Math.PI + Math.PI / 4;
segment.y = currentY;
segment.x = currentX;
var adjustedHeight = segment.height - segmentWidth / 2;