Creating a score for the distance my actor has travelled

Hey, i have a platform endless runner game, i'm looking to add a score on how far the actor can get without crashing into the enemies.
I got the display box for the score, but the actor is not moving, the background and other actors are moving.... Whats the best way around this please? New to all this!

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You mean you want your score actor/display to stay on screen right?

    If so add that actor to it's own layer and make that layer non-scrollable.
  • MattyB2489MattyB2489 Member Posts: 6
    not quite. So just need a score to be generated as my actor goes through the level. The scorebox is staying on screen which is good. thanks for the comment
  • Thunder_ChildThunder_Child Member Posts: 2,343
    I woukd be interested in an answer as well. Sorry I have no experience other than I see this in the nega jump template also...i believe it woukd just be the same a a counter...like a timer that is displayed. Every (.25) seconds change attribute +1 or what ever. Yes/no? Coukd it be that simple?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @Thunder_Child yes, it can be that simple.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Yes indeed, that is exactly what I've done for an endless runner, just increment and number over time and use that as your distance.
  • MattyB2489MattyB2489 Member Posts: 6
    Thanks for all the comments. I got the scoreboard up, but it's staying on 0. Is this because the airplane is fixed in one place....?
    Sorry really new to all this stuff.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You need to add a Behavior to one of your actors that says something like:

    Timer -> every 1 seconds (or however often you like)
    Change Attribute -> Distance = Distance + 1

    Assuming Distance is the name of the Attribute you are using for your score/distance/scoreboard.

    Hope that helps.
  • MattyB2489MattyB2489 Member Posts: 6
    AWESOME! It worked! Thanks guys!! :)
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    great, you're welcome!
  • Thunder_ChildThunder_Child Member Posts: 2,343
    Holy crap I got it right ? Whoohoo !
Sign In or Register to comment.