GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How can I display the distance travelled as a score like Tiny Wings

Gamer1992Gamer1992 Posts: 83Member
edited November -1 in Working with GS (Mac)
I'm making a running game, and I was wondering if anyone can show me how to make my score based on the distance I travel like Tiny wings or icopter.? thanks.

Comments

  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    well you could just use the self.position.x as a score if you wanted. Display that or have a score attribute thats displayed to that. Just make sure your characters starts in the middle of the origiinal camera zone so it doesnt go negative at the begingning. You could also multiply that by whatever if u want a bigger score.

    The other thing u can do is just have a timer that adds to a score attribute every 0.1 seconds your playing.

    Hope that helps
  • Gamer1992Gamer1992 Posts: 83Member
    @JohnPapiomitis I'm a newbie so can you please type the rule here for me please? I will really appreciate it. thanks
  • LumpAppsLumpApps Posts: 2,868Member
    @John time alone isn't enough or am I wrong? The velocity should be added in the equation because when you go faster, the distance you travel is more.
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    LudwigHeijden said:
    @John time alone isn't enough or am I wrong? The velocity should be added in the equation because when you go faster, the distance you travel is more.

    if you have different changes in speed then your correct, he didnt mention that though so i left it out to not confuse him. If your going at one constant speed then thats not needed.
  • Rob2Rob2 Posts: 2,402Member
    @ Lud +1 its more about the distance your background has travelled combined with time ;)
This discussion has been closed.