GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,915

    I appreciate that you posted an explanation of your rules but is it possible for you to post a link to download your project file or at least screenshots of the rules? I'm finding it hard to follow everything the way it's written.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,915

    Also, it seems like you're using an actor tag to refer to an actor with a different image. That's not how tags work. So maybe it will make more sense when I can see your project (or screenshots).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ucjumr2ucjumr2 Member, PRO Posts: 6

  • ucjumr2ucjumr2 Member, PRO Posts: 6

  • ucjumr2ucjumr2 Member, PRO Posts: 6

  • ucjumr2ucjumr2 Member, PRO Posts: 6

    @tatiang Here are screenshots of my rules!

Sign In or Register to comment.