GameSalad

Howdy, Stranger!

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

Compare actors

WalaskyWalasky Posts: 10Member
edited March 2015 in Working with GS (PC)

Hi guys, how can i compare two actors, for example if i have an oranje, a banana and a apple, and if i touch the correct actor the game have to change to another scene but if the actor is incorrect do nothing.
Im using windows version

sorry for my bad english.

Comments

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

    Give each actor an actor attribute of type integer called self.fruit. Double-click on each actor in the scene and change self.fruit to a unique number (e.g. orange could be 1, banana could be 2, apple could be 3, etc.). In the "correct" actor, change game.correctFruit (also an integer) to self.fruit. In the fruit actor's prototype rules, have a rule that says:

    If touch is pressed
         If attribute self.fruit = game.correctFruit
              Change Scene

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

  • WalaskyWalasky Posts: 10Member

    Ok, let me try it, thanks

Sign In or Register to comment.