Increase points when tapped
myu699
Member Posts: 96
Hi, I am creating a game where you have to tap an object to get some extra points. I am trying to figure out how to make it so that when actor 1 is tapped then it adds +1 to the current value of a table. Could someone tell me how to do this. Also I would like to know how many columns and rows are needed in the table. A picture would help a lot!
Comments
Is there a reason you're using a table? It's much simpler to use a single attribute:
If touch is pressed
Change Attribute game.score (integer) to game.score+1
Or are you wanting to keep separate scores for each object? In that case, you would need a table. Each row would represent an object and the first column would represent the score. To increase the score for an object, you would do:
If touch is pressed
Change Table Value [tableName] row: [whichever object # you tap] column: [1] value: tableCellValue(tableName,[the object #], 1)+1.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Have a look in these two places and you should find what you are after and you can also Google it.
https://www.youtube.com/user/GameSalad?annotation_id=annotation_3740352209&feature=iv&src_vid=9j-9iosWDME
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
sorry, i am pretty new to game salad(got it today) and how do you create a attribute, could I just create an actor, and give it a value then create a rule where if it is tapped then change attribute.
Start with the GameSalad Cookbook or a few video tutorials to get familiar with how it works. From the FAQs: http://forums.gamesalad.com/discussion/66768/forum-faq#windows.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah I figured it out check out some of the cookbooks. Thanks guys!
Hi, one more thing. I am creating a score display. I was wondering how I put the points displayed in one scene and then put it into another
Use the same actor with a game level attribute to hold the score value.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
how do you do that?
Use "display text" behavior, and choose the score attribute from the expression editor.
Mental Donkey Games
Website - Facebook - Twitter