How to calculate a distance in an endless runner

Hello,

I'm working on a little endless running.To keep it simply I'm currently adding a point per second to calculate the score. I would like to add distance traveled so when they hit 100, 1000 yards, etc I can display a sign of the distance traveled and use it for challenges. It doesn't have to be exact is their a quick calculation for time = distance I could create to generate? Thanks in advance.

Comments

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    edited August 2014

    Create a integer attribute called Distance
    Every 1 second change Distance to Distance+1
    When Distance = 100 Spawn distance sign

  • pHghostpHghost London, UKMember Posts: 2,342

    Just decide how many yards you want to add per second.

    Then you can do something like

    Every 0.3 seconds add 1 to distanceTimer

    Then just display 'yards' at the end of the score display.

    For the sign, do a rule, which spawns a sigh every time the distanceTimer is divisible by 100, and print the score on it.

    Small example attached.

  • BaDDAppleBaDDApple Member Posts: 49

    Wow, forgot to stay thank you.

Sign In or Register to comment.