True & False

jstrahanjstrahan Member Posts: 498
edited November -1 in Working with GS (Mac)
can you change between true and false with math in gs using something like (x=0&1)

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Do you mean bitwise operators? I don't believe GS has them.

    you can use something similar like modulus:

    myCurrentState = (myCurrentState + 1)%2

    which will toggle myCurrentState between 0 and 1.

    GameSalad does not see 1 and 0 as true and false,
    but you can still react to them in a similar way.
  • jstrahanjstrahan Member Posts: 498
    ok thanks i was trying to reduce the code as much as possible to turn music on and off i think this will work if i change the variable to an integer instead of a boolean
  • jstrahanjstrahan Member Posts: 498
    yep that worked perfect now i got 1 math problem that changes the state of the variable instead of using some rules to switch between true and false
Sign In or Register to comment.