Jump to content


Photo

need programming help<SOLVED>


  • Please log in to reply
2 replies to this topic

#1 gangstavexx

gangstavexx

    GMC Member

  • GMC Member
  • 39 posts
  • Version:Unknown

Posted 24 August 2011 - 01:11 PM

Hi there,
I would just like to ask if there is any sort of "or" statement or function in GameMaker. I did take a class teaching java, and with this language, or could be done as "||" but that doesnt seem to work here :/ so i was wondering if its in game maker? if so how is it used? maybe an example?

Thanks alot guys! :D

Edited by gangstavexx, 24 August 2011 - 02:03 PM.

  • 0

#2 Fireelight

Fireelight

    GMC Member

  • GMC Member
  • 109 posts

Posted 24 August 2011 - 01:20 PM

|| and or works perfectly as it should.
It must been something with your other code. :)

Edit, yeah example:

if global.world_dies=true || global.no_it_dont=false
{
syntax_error=true
}

Edited by Fireelight, 24 August 2011 - 01:24 PM.

  • 0

#3 filulilus

filulilus

    GMC Member

  • GMC Member
  • 928 posts
  • Version:GM:Studio

Posted 24 August 2011 - 01:40 PM

From GM help file:

• && || ^^: combine Boolean values (&& = and, || = or, ^^ = xor)
• < <= == != > >=: comparisons, result in true (1) or false (0)
• | & ^: bitwise operators (| = bitwise or, & = bitwise and, ^ = bitwise xor)
• << >>: bitwise operators (<< = shift left, > > = shift right)
• + -: addition, subtraction
• * / div mod: multiplication, division, integer division, and modulo


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users