Bouncing balls of changing colors

0 favourites
  • 9 posts
From the Asset Store
Bouncing ball
$9.99 USD
Template for a bouncing ball game, fully documented in comments and video
  • 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.

    speedy.sh/WfDf6/Plague.capx

    Many thanks,

    Orwin

  • 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 = 0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, but how can i implement the code you've just written?

  • 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 <img src="smileys/smiley5.gif" border="0" align="middle" /> Hopefully someone will help

  • Maybe Ramones can help.

  • Was this the effect you were looking for?

    Bouncy ball collisions

  • Yes, it was that one :)

    Actually, now i am trying to make the balls change other ones' colors.

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

    Thank you a lot.

  • 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.

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