distance ran tracker

someone help me with a distance tracker for my endless runner game? thanks a bunch in advanced , i cant seem to get it right

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Create an integer game attribute called Distance.

    Create a rule: When game.GameOver is false,
    -Timer: every 0 seconds,
    --Change Attribute: game.Distance to game.Distance+1.
    

    Extremely simple once you think about it. Hope this helps.

  • YourFace710YourFace710 Member Posts: 13

    @Braydon_SFX‌ ok, now the part i was having trouble with is having numbers counting the distance on screen

  • SocksSocks London, UK.Member Posts: 12,822

    @YourFace710 said:
    Braydon_SFX‌ ok, now the part i was having trouble with is having numbers counting the distance on screen

    Is your actor always running or does he stop at any stage during the game ?

  • YourFace710YourFace710 Member Posts: 13

    @Socks the actor isnt always running he can stop at any time

  • SocksSocks London, UK.Member Posts: 12,822

    @YourFace710 said:
    Socks the actor isnt always running he can stop at any time

    I see, I was going to suggest using the internal clock, but that's no good if he stops.

    As for your question about @Braydon_SFX 's post . . .

    "the part i was having trouble with is having numbers counting the distance on screen"

    . . . just have a Display Text behaviour that displays game.Distance

  • YourFace710YourFace710 Member Posts: 13

    @Socks said:
    . . . just have a Display Text behavior that displays game.Distance

    @Socks displaying text doesn't seem to work. the text that pops up is "true" also , any suggestions for a actor that doesn't continuously run?

  • SocksSocks London, UK.Member Posts: 12,822

    @YourFace710 said:
    displaying text doesn't seem to work. the text that pops up is "true"

    If you use Braydon's code . . .

    When game.GameOver is false,

    -Timer: every 0 seconds,

    --Change Attribute: game.Distance to game.Distance+1.

    . . . and if like he says the attribute game.Distance is an integer attribute, and you select that attribute in the drop down menu for your text display it will display game.Distance . . . . it would only show 'true' is you had selected a boolean attribute.

    . . . . . . .

    @YourFace710 said:
    also , any suggestions for a actor that doesn't continuously run?

    Presumably the actor is moved by a button or key . . ? Let's imagine it's the right arrow key.

    When right arrow key is down

    -Timer: every 0 seconds,

    --Change Attribute: game.Distance to game.Distance+1.

  • YourFace710YourFace710 Member Posts: 13

    @Socks This almost works. But a problem still remains, holding down the right arrow will up game.Distance by 1 and just stop, continuous clicks are needed to add game.Distance up.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @YourFace710 said:
    Socks This almost works. But a problem still remains, holding down the right arrow will up game.Distance by 1 and just stop

    Are you using these rules ?

    When right arrow key is down

    -Timer: every 0 seconds,

    --Change Attribute: game.Distance to game.Distance+1.

    Could you upload a screenshot of your rules ?

    . . . . . .

    You didn't respond to the issue about 'displaying text doesn't seem to work. the text that pops up is "true" Did that issue resolve itself ?

  • YourFace710YourFace710 Member Posts: 13

    @Socks i fixed the text display bug by changing the attribute to an integer , here are the rules http://gyazo.com/9fa48a4d95f84a12d2042b19bc381623

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @YourFace710 said:
    Socks i fixed the text display bug by changing the attribute to an integer

    Ok, that makes sense.

    Your change attribute behaviour has to go inside the timer.

  • YourFace710YourFace710 Member Posts: 13

    @Socks , your awesome I would give you a cookie , but I'm too busy developing thanks for the help! Ill let you know when my app is on the app-store / play store seeing that you have helped me alot already!

Sign In or Register to comment.