Distance traveled????
kylemik23
Member Posts: 7
Say i want to measure how far a ball can go up. How would i measure that and tell the player how far the ball traveled up at the end of the game? Screenshots would be extremely helpful
Comments
It'll really depend on how you're moving the ball, how you trigger it, how it's brought down again/if it's brought down again. Perhaps use something like this, though:
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
i couldn't thank you any more. THHHHAAAAANMKKKKKKKKKKK UUUUUU
Glad it helped!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline Question - How would you calculate the distance traveled if you were using a scrolling background? Say you were launching a rocket (ie Kerbal Space program) and you had a scrolling sky background but wanted to know how far your rocket flew upwards?
Thanks!
You could do it the same way, you'd just need to take into account the amount the camera had moved. So you'd need to record the camera's starting position (likely 0,0), and then track how far it moves in relation to the moving object. This is pretty simple if your camera's tracking area is very small (i.e. the size of the moving object or smaller) but needs a little more maths if you're using a bigger tracking area (as you need to calculate how far the object moves before the camera starts moving, then add it to the distance the camera moves for the final distance).
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support