How do I round numbers to the nearest multiple

Get help using Construct 2

Post » Thu Oct 02, 2014 1:36 pm

What I need to know is how to round the Sprite.X of an object to the nearest multiple of 80. For example if Sprite.X = 76 I want it to round up to 80 or if Sprite.X = 178 i want it to round down to 160. I know round(Player.X) rounds the number to a whole number but i need it to round to the nearest 80.

Thanks :}
B
9
S
3
G
2
Posts: 53
Reputation: 1,789

Post » Thu Oct 02, 2014 1:43 pm

round(Sprite.X/80)*80
ImageImageImage
B
72
S
22
G
290
Posts: 3,886
Reputation: 159,513

Post » Fri Oct 03, 2014 6:26 am

thankyou very much
B
9
S
3
G
2
Posts: 53
Reputation: 1,789


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests