Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DrewCCU on Fri 09/04/2010 02:50:41

Title: greater than, less than?
Post by: DrewCCU on Fri 09/04/2010 02:50:41
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?
Title: Re: greater than, less than?
Post by: Gilbert on Fri 09/04/2010 02:59:36
???
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)
Title: Re: greater than, less than?
Post by: Crimson Wizard on Fri 09/04/2010 12:04:14
Also, you may want to type "Operators" in the manual's Index.  ;)
Title: Re: greater than, less than?
Post by: DrewCCU on Fri 09/04/2010 20:52:31
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