Create a bar that increases with the percentage of completion of the level?

How can I create a percentage on the screen during the game that increases depending on how little it takes to get to the end of the level?

If you want to make a platform, you can write this expression:
ToString((player.X()-start.X())/(end.X()-start.X())*100)+"%".
Replace player with the player’s name, start.X() with the X of the start point and end.X() with the X of the end point.
I hope that helps!

2 Likes

Please explain and i don’t need the player on the bar but the bar level increases

Try to create a tiled sprite object and set as sprite the image of the bar you want to inser. Then create an event without condition like this:
“Change the width of bar: set to (player.X()-start.X())/(end.X()-start.X())*num
Replace bar with the name of the object that you created, player with the name of the controllable object, start.X() with the X of the start point, end.X() with the X of the end point and num with the width of the bar’s image.
Hope any doubts have been cleared up!

1 Like