How to change actor color on trigger (when hit by another actor)

I'm trying to make a pong style game where ball 'A' is controlled by a player to aim and shoot to hit other balls.

problem:

I want the balls that the player hit, to change color on contact. can someone help me set this rule?

thank you!

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2014
    Rule for the ball:

    When Actor overlaps or collides with 'Player' . . .
    Change Attribute: self.color.Red to AAA
    Change Attribute: self.color.Green to BBB
    Change Attribute: self.color.Blue to CCC


    . . . . . . . .


    AAA = a value between 0 and 1
    BBB = a value between 0 and 1
    CCC= a value between 0 and 1

    So, if you want the ball to turn red you would use . . . .

    Change Attribute: self.color.Red to 1
    Change Attribute: self.color.Green to 0
    Change Attribute: self.color.Blue to 0

    Or pink . . . .

    Change Attribute: self.color.Red to 1
    Change Attribute: self.color.Green to 0.5
    Change Attribute: self.color.Blue to 0.5

    Or yellow . . .

    Change Attribute: self.color.Red to 1
    Change Attribute: self.color.Green to 0.75
    Change Attribute: self.color.Blue to 0


    . . . . etc etc

  • SocksSocks London, UK.Member Posts: 12,822
Sign In or Register to comment.