How boolean works

  • I don't know which logic did you use

    event (on object clicked blackButton)

    __for each object red

    ___set position to somewhere outside layout

    __for each object black

    ___set position to somewhere inside layout

    and do the opposite for red button

    or with one boolean you could do like this

    event (on object clicked coloredButton)

    _for each coloredSprite

    __if (coloredButton.isRed != coloredSprite.isRed)

    ___set position to somewhere outside layout

    __else

    ___set position to somewhere inside layout

    you have to set one colored button to true and the other one false

    I have no idea what are you trying to do with this, some people don't like to show their work publicly, I'm not sure whether this forum has a PM function or reach me with skype assaji.tjahjadi

  • Some images I've posted in the past, this one isn't boolean, but on a click moves the family of sprites off screen.

    You could add a line to do the same to other sprite. Exact same line, as it's a toggle, swapping them back and forth. (this can be used to make a menu full of buttons appear and disappear in one event.)

    Or here is a boolean toggle, when the sprite is touched, it flips between frame 0 and 1. (the 1 can be any frame)

    When (sprite.animationframe=0) is true, it equals 1, so multiplying 1 by it equals 1, if it's false, it's 0, and multiplying 1 by it is 0.

    Or using boolean in the 3rd and last two actions of this game of pong written in two events:

    The third action down sets the opacity of the winner declaration, 0 if the score is less than 10, 100% if it's above.

    the PaddleAI action sets the direction of the computer's paddle, depending on the Y position of the ball compared to the paddle.

    And the last action sets the ball speed ever increasing, unless the score is 10 or over, in which case it sets the speed to 0.

    QuickyPong Capx - or play it here.

  • dropbox.com/s/woxx731vwzqud ... .capx?dl=0

    in this sample i have shown what i need

    I don't know which logic did you use

    event (on object clicked blackButton)

    __for each object red

    ___set position to somewhere outside layout

    __for each object black

    ___set position to somewhere inside layout

    and do the opposite for red button

    or with one boolean you could do like this

    event (on object clicked coloredButton)

    _for each coloredSprite

    __if (coloredButton.isRed != coloredSprite.isRed)

    ___set position to somewhere outside layout

    __else

    ___set position to somewhere inside layout

    you have to set one colored button to true and the other one false

    I have no idea what are you trying to do with this, some people don't like to show their work publicly, I'm not sure whether this forum has a PM function or reach me with skype assaji.tjahjadi

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • luckyrawatlucky - please check your link.

  • dropbox.com/s/woxx731vwzqud ... .capx?dl=0

    luckyrawatlucky - please check your link.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)