Bouncing balls of changing colors

Get help using Construct 2

Post » Sat Mar 30, 2013 5:37 pm

Guys,


I come again for your aid, since i couldn't solve another problem in my project on my own. This time, i've tried to modify a project found here in the forums, so it would suit an idea of mine, but to little end.

As you may see in the project that i will submit, we have two player-controlled balls that modify the color of each bouncing ball they touch. So far, i was successfull on that.

Unfortunately, i couldn't add the last condition to my prototype, which is: every ball that had its colour changed by a player-controlled ball may change another ball's color only once.

That is, the player touches a blue ball, and that ball will modify the next ball it touches to the color that it has after being touched
by the player.

The second ball in the sequence cannot modify any other ball's color.

Can you help me with that? I tried do it by creating different frames of the same object and attempting to make them change after collisions, but it also didn't go well.

Do you folks have any idea how to do that? I'm really lost.

http://speedy.sh/WfDf6/Plague.capx


Many thanks,
Orwin

B
4
Posts: 11
Reputation: 347

Post » Sat Mar 30, 2013 5:40 pm

you need:
on ballID1 click:
set globalVariableAffectColor = 1
set colorFrameVariable = ballID1 frame
and an event:

True on globalVariableAffectColor = 1
inside the event:
on ballID2 collision with ballID1: set ballID2 frame to colorFrameVariable
set globalVariableAffectColor = 0California2013-03-30 17:42:44
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Sat Mar 30, 2013 7:52 pm

Sorry, but how can i implement the code you've just written?
B
4
Posts: 11
Reputation: 347

Post » Sun Mar 31, 2013 3:58 pm

Hi again man, sorry I'm struggling with this too! I'm sure it has to do with IID, but I can't get it to work Hopefully someone will help
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Sun Mar 31, 2013 5:23 pm

Maybe Ramones can help.
B
4
Posts: 11
Reputation: 347

Post » Sun Mar 31, 2013 6:35 pm

Was this the effect you were looking for?

Bouncy ball collisions
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Sun Mar 31, 2013 7:40 pm

Yes, it was that one :)

Actually, now i am trying to make the balls change other ones' colors.
B
4
Posts: 11
Reputation: 347

Post » Sun Mar 31, 2013 7:41 pm

Hey, you've just solved the problem i was having!!

Thank you a lot.
B
4
Posts: 11
Reputation: 347

Post » Sun Mar 31, 2013 7:49 pm

On the collision of "charged" balls, both objects would exchange colors, for the effects would mutually apply and a two-way transfer would occur. Did you implement that possibility, Vee?


Again, thanks a lot for your support.

B
4
Posts: 11
Reputation: 347


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests