Change actor1 to actor 2 while clicking on actor 3?

ucjumr2ucjumr2 Member, PRO Posts: 6

In one level of my game, coloured fish come across the screen and if they hit trash, they will turn gray and stop. I have completed this part and it seems to work.

**Rule: Change Gray Fish
If all of the following conditions are valid:
this actor overlaps or collides actor with tag "trash"

Then:
Rule: Stop Movement
If all of the following conditions are valid:
the attribute self.aspects.motion.linearVelocity.x = 0;
the attribute self.aspects.motion.linearVelocity.y = 0;

  Then
  Change Image 
     Change Image to Gray Fish**

However, when once the player removes the piece of trash, the fish should turn coloured again. I feel like I am using the correct logic. This is the rule I have under the "trash" actors:

**Rule: Change Gray Fish
If all of the following conditions are valid:
this actor recieves touch pressed

Then:

  Rule: Change Grad Fish 2
  If all of the following conditions are valid:
     this actor receives event overlaps or collides actor of type "Gray Fish"

  Then
  Change Attribute 
     Change Attribute game.Pfish to (True)**

This is what I have under gray fish, so they turn back to coloured fish after a piece of trash is destroyed.

**Rule: Change Back to Pink Fish
If all of the following conditions are valid:
the attribute game.Pfish true

Then:
Change Image
Change Image to Pink Fish**

Right now, when I preview my game, the fish turns grey on collision and stop moving, but does not turn back to coloured once I destroy the trash. It does start moving again though. I have made sure everything was spelled correctly and the boolean is not checked. I don't know if this rule clashes with another rule I have but I feel like I have tried everything.

Comments

Sign In or Register to comment.