Log in
Search
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.Rounding variables??
3 posters
:: Game Making :: Game Maker Help :: Game Dev. Q&A :: GML help (Coding)
Page 1 of 1
Rounding variables??
How do I round a variable?
Like if a variable is 1.2 how do I round that to 1?
Like if a variable is 1.2 how do I round that to 1?
The Puppet Master- Game5L
- Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla
Re: Rounding variables??
I suppose you could try something like
if variable is less than 1.5 then
variable = 1
if variable is more than 1.5 then
variable = 2
etc.
Probably not the best choice but whatever.
if variable is less than 1.5 then
variable = 1
if variable is more than 1.5 then
variable = 2
etc.
Probably not the best choice but whatever.
Re: Rounding variables??
I want the variable to change though, and every time it changes it gets rounded
The Puppet Master- Game5L
- Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla
Hepolite- GameML Noob
- Posts : 23
Points : 54587
GameML Reputation : 12
Join date : 2009-06-03
Age : 31
Location : Land far, far away from the land far, far awaay
Re: Rounding variables??
ok thanks
The Puppet Master- Game5L
- Posts : 471
Points : 55071
GameML Reputation : 4
Join date : 2009-06-03
Age : 29
Location : Valhalla
:: Game Making :: Game Maker Help :: Game Dev. Q&A :: GML help (Coding)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|