what is the use of boolean?

calvin9403calvin9403 Member Posts: 3,186
edited November -1 in Working with GS (Mac)
if you can just use integer for 0/1, than there is no use of it.

Comments

  • Rob2Rob2 Member Posts: 2,402
    In theory it is very memory efficient as it is only using 1 bit.
  • calvin9403calvin9403 Member Posts: 3,186
    Rob2 said:
    In theory it is very memory efficient as it is only using 1 bit.

    I bit and 4 bit is not a big different though
  • calvin9403calvin9403 Member Posts: 3,186
    than Gs should have integer and double...
  • Rob2Rob2 Member Posts: 2,402
    I expect there are other reasons, I'm pretty sure that it is very efficient processor wise when testing in rules.
  • UtopianGamesUtopianGames Member Posts: 5,692
    I use Boolean for all sorts of things...character animation when you have a lot of it is better with Boolean imo.

    I have found Integers are unrealiable in certain situations.

    Darren.
  • okimokiokimoki Member Posts: 159
    integers are essential i think.. is the penguin dead? true! then do this.. is the objective complete? false! then do nothing..
  • ZackGSZackGS Member Posts: 313
    utopiangames said:
    I have found Integers are unrealiable in certain situations.

    Darren.

    Care to elaborate ? I can't see how using an integer toggle over a boolean toggle can be unreliable if you are managing the toggle correctly. It is the same thing.

    (boolean) True = Anything non 0
    (boolean) False = 0
  • ozboybrianozboybrian PRO Posts: 2,102
    I am getting Booleans but still confused :/
    Ace has helped me out though but I do agree Booleans are essential cause in one of my games for the most silly reason the interger goes over 1 then the game plays up.
    .
    .
    .
    -----------------------------------------------------
    Join the GameSalad Community and have your game noticed for free.
    http://www.facebook.com/ListYourTopiPhoneGame
    List your Top iPhone Game on FaceBook!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Even though an integer can do 0=False and 1=True, it also can go all the way up to eleventy trabillion in value. A boolean is a simple true or false, nothing more to keep track of. I think that may be where the performance comes in to play if you are using a lot of them.

    I use a lot of text attributes myself. Especially for controls.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    While on the small scale, a Boolean takes up much less memory. In a small game it probably doesn't matter much, but if you have hundreds of attributes like I do, every little thing counts
  • ozboybrianozboybrian PRO Posts: 2,102
    I think an advanced Boolean video is required.
    .
    .
    .
    -----------------------------------------------------
    Join the GameSalad Community and have your game noticed for free.
    http://www.facebook.com/ListYourTopiPhoneGame
    List your Top iPhone Game on FaceBook!
Sign In or Register to comment.