How to round to nearest whole number
ericzingeler
Member Posts: 334
Some of you may already know this, but for those of you who don't.
To round to the nearest whole number, just throw your result into an index or integer attribute.
To round to the nearest whole number, just throw your result into an index or integer attribute.
Comments
@ericzingleler
Yes, good one, Eric; also -for those who don't know - can use the floor or ceiling function during runtime.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
actor receives event touch
ypos = self.position.y
interpolate self.postiion.y to ypos
On the actor I put a [display text] and after about 5 clicks, it goes to a number like 299.99906156703 though every other move it is a whole number. The problem is I have a trigger for another event that was if x = 300. So 299.99906... does not trigger it. I fixed it by going if ypos<201 and ypos>299 but the point it, it "should" always give me a whole number. correct?