Compare actors
Walasky
Member Posts: 10
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
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
Ok, let me try it, thanks