Increase points when tapped

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

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

    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.

  • colandercolander Member Posts: 1,610

    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

  • myu699myu699 Member Posts: 96

    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.

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

    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.

  • myu699myu699 Member Posts: 96

    Yeah I figured it out check out some of the cookbooks. Thanks guys!

  • myu699myu699 Member Posts: 96

    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

  • colandercolander Member Posts: 1,610

    Use the same actor with a game level attribute to hold the score value.

  • myu699myu699 Member Posts: 96

    how do you do that?

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Use "display text" behavior, and choose the score attribute from the expression editor.

Sign In or Register to comment.