How do I Set Opacity on Refresh

Get help using Construct 2

Post » Fri May 20, 2016 9:12 pm

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
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Fri May 20, 2016 9:31 pm

Holy Cow I think I figured it out. dirty I'm sure, but check it out.

Image
B
21
S
7
G
1
Posts: 128
Reputation: 3,076


Return to How do I....?

Who is online

Users browsing this forum: kalibark2 and 27 guests