User prompt
Road segments should be between 200 and 1000 px long and always 400 px wide
User prompt
do not set width and hight when creating a road segment
User prompt
Only add 10 road segments
User prompt
Road segments should have anchor .5, 0
User prompt
We need a track to drive on! The track should be made up of road segments that zigzag up the screen
User prompt
half particle lifetime
Code edit (1 edits merged)
Please save this source code
User prompt
don't spawn particles if the alpha that would be attached to it is zero
Code edit (1 edits merged)
Please save this source code
User prompt
set min of particle alpha to 0
Code edit (4 edits merged)
Please save this source code
User prompt
when looping particles in game tick, remove particle if lifetime is < zero rather than alpha
User prompt
In particle tick, don't set alpha, simply just destroy the particle when alpha reaches zero
User prompt
when calculating particle alpha subtract .5 after abs'ing the value
Code edit (1 edits merged)
Please save this source code
User prompt
rotate particleGraphics 45 degrees
User prompt
add 5px random x,y noise to particles x,y
User prompt
subtract a total of 300 px from offset y
User prompt
subtract 150px from the offsetY target
User prompt
divide offset x and y by 20 and set offsetY target to the height of the game
Code edit (1 edits merged)
Please save this source code
User prompt
Update the offsetY calculation such that the target y is 1/4th from the bottom
Code edit (2 edits merged)
Please save this source code
User prompt
when setting particle alpha divide nonTravelMomentum by 5
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -93,10 +93,10 @@
particles.splice(index, 1);
}
});
var carLocalPosition = self.toLocal(car.position, car.parent);
- var offsetX = (2048 / 2 - carLocalPosition.x) / 5;
- var offsetY = (2732 / 4 * 3 - carLocalPosition.y) / 5;
+ var offsetX = (2048 / 2 - carLocalPosition.x) / 15;
+ var offsetY = (2732 / 4 * 3 - carLocalPosition.y) / 15;
mainContainer.x += offsetX;
mainContainer.y += offsetY;
});
});