How do I Set Opacity on Refresh

  • I'm sure there is a simple way to do this but everything I try fails. I have 3 instances of an object. On touch I add 5 to an array value and I set the opacity on the instance touched to 50%. Essentially creating a toggle. The user can toggle each one one/off I have that working and the array adds/subtracts 5 for each one toggled np.

    The issue I have is if you hit NEXT (another object in the game), I reset the opacity of all 3 instances to 100%. Reason for this is that you are now on the next player and can toggle them on/off for him. The NEXT object cycles through all players back to the first player. What I want to do is when you come back to a player that you already toggled some to 50% I want the 3 object instances to show that.

    For example:

    Player 1: 2 of 3 toggled

    Player 2: 1 of 3 toggled

    When you cycle back to player 1 the game should set the opacity of 2 of the instances to 50%. I can use the value in the array (which would be 10 in this case) to get the number of instances to set to 50% (array value/5 = 2). What I cant figure out is how to set the 2 instances to 50%

    I hope someone follows that logic and can help. thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Holy Cow I think I figured it out. dirty I'm sure, but check it out.

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