greater than, less than?

Started by DrewCCU, Fri 09/04/2010 02:50:41

Previous topic - Next topic

DrewCCU

i have this in my script:

if (oAsteroid1.X == 802)

however i need something like:

if (oAsteroid1.X == >802)

to show that if the x value is ever GREATER than 802 something needs to happen. Is there a simple way to do this?
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

Gilbert

???
To check 'greater than' or 'smaller than' you just need:
if (oAsteroid1.X > 802)
or
if (oAsteroid1.X < 802)

And if you want 'greater than or equal to' or 'smaller than or equal to':
if (oAsteroid1.X >= 802)
or
if (oAsteroid1.X <= 802)

Crimson Wizard

Also, you may want to type "Operators" in the manual's Index.  ;)

DrewCCU

Quote from: Crimson Wizard on Fri 09/04/2010 12:04:14
Also, you may want to type "Operators" in the manual's Index.  ;)

yeah - i actually figured it out right after i posted. lol. i'm new to ags code but picking up kind of fast.  At first i didn't know what the =,!,==,<,> and all that was called - then i found out they were operators - then it made it easy to learn about them. lol. thanks though
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

SMF spam blocked by CleanTalk