Percent of level ran

myu699myu699 Member Posts: 96

Hey guys, I am creating a running game(not endless). It has multiple levels(that end) and I want to be able to give the player a percent to show how much of the level they passed(like in geometry dash) but I am unable to find anyways of calculating how far the runner ran. I don't need constant live updates of their percent while they play. I only want to show the percent they have ran in the end. Thanks!

Comments

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956
    edited April 2015

    @myu699

    Take player's x position.

    Display Text.

    roundTo(( self.Position.X / scene.Size.Width )*100,0).."%"

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @myu699

    Player's position relative to scene width. Then changed into percentage form.

  • myu699myu699 Member Posts: 96

    ok thanks!

Sign In or Register to comment.