How would I make it so that if I tap the right actor, the score will increase
azntree0000
Member Posts: 1
I'm pretty new to GameSalad and I'm making a game where the player has to tap on the correct randomly spawned object. the idea is that the game tells the player which object to tap and the player has to tap it as soon as possible to score a point. I just can't figure out how to make the actor correspond with the object that the player is supposed to touch.
Comments
Let's say you have 10 different objects. Give each actor or instance of an actor a unique ID (self.ID=1, self.ID=2, etc.).
Change attribute game.randomObjectNum to random(1,10)
If attribute self.ID=game.randomObjectNum
If touch is pressed
Change game.score to game.score+1
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Make an integer attribute named "score"
Inside the actor that you want to put score on touch make a rule
-When touch is pressed,
-change attribute, game.score to game.score+1
Maybe this will work.
PS: There are a lot of tutorials on beginning stuff on youtube, check them.