Hello friends, i'm making a game that gets a score by the max height the player can reach, but the value of player.y is everytime a float like "108.108846150" and this is poor for the design. So how do I convert this float value "108.108846150" to a simple int "108"? Any ideas?
Set ScoreValue to int(player.y)
Alternately floor(player.y), ceil(player.y), or round(player.y)
Develop games in your browser. Powerful, performant & highly capable.
That's exactly what I wanted, thank you!
Just a thing to tell you that int will alway make the number positive so if you want negative number you will have to use alternative way
int() works for negative numbers.
int(3.14) = 3
int(-3.14) = -4