Pinball toggle button/pad

0 favourites
  • 6 posts
From the Asset Store
Toggles Dials Switches and Alerts ! A foundational sound grouping of Analog type switches and Steampunk effects
  • I'm working on a pinball game, and at the top I've got the three roll over buttons. Generally, by pressing the left or right flipper you can toggle the ones on to off and vice versa. I'm having some difficulty implementing the switch from the paddle buttons.

    The buttons switch properly, on becomes off, off becomes on... But the variable im trying to set with how many are on and off does not change. I've spent the last 10 years scripting in 3d game studio, and I still don't fully understand how construct flows.

    toggle1_1 is a global variable

    active is an instance variable

    <img src="http://s24.postimg.org/o27k4lypx/Untitled.jpg" border="0" />

  • Edit

    never mind.....

    I'm tired and talking bo**ox.....

  • Why not use a boolean for the active variable?

    and use a for each sprite

    sprite is active

    add 1 to totalactive

  • 1-variable would work also, it has the same effect as toggle boolean.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the 'for each' definitely saved the day. everything seems to be working fine except for the toggle button on the right :( it doesnt seem to want to... toggle. I better put on some coffee. thanks for the help. im sure ill be posting again pretty quick. ill be sure to rip some hair out of my head before i do though.

  • DOH. It was just the placement of checking if the global variable was 0 (so you cant just flick them all on with the paddle). I just rearranged the events so the check was done before 'for each', and BAM.

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