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

Gamer1992Gamer1992 Member Posts: 83
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 Member Posts: 6,256
    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 Member Posts: 83
    @JohnPapiomitis I'm a newbie so can you please type the rule here for me please? I will really appreciate it. thanks
  • LumpAppsLumpApps Member Posts: 2,881
    @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 Member Posts: 6,256
    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 Member Posts: 2,402
    @ Lud +1 its more about the distance your background has travelled combined with time ;)
Sign In or Register to comment.