Help With Table Coding?
jblb2424
Member Posts: 65
Hello!
Quick question. I have a star system in my game and use a simple star system to operate it. What i am now trying to do is make a system where you need to obtain a certain amount of stars to unlock new worlds, similar to the game "Cut The Rope". Im not sure how to do this with tables, but i would probably need a line of code that says "When the sum of all numbers in row 1 reach 50, unlock new world"
How can i accomplish this? Any help would be greatly appreciated. Thanks!
Quick question. I have a star system in my game and use a simple star system to operate it. What i am now trying to do is make a system where you need to obtain a certain amount of stars to unlock new worlds, similar to the game "Cut The Rope". Im not sure how to do this with tables, but i would probably need a line of code that says "When the sum of all numbers in row 1 reach 50, unlock new world"
How can i accomplish this? Any help would be greatly appreciated. Thanks!
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Then add an actor that checks the table based on some condition (e.g. each time you collect a star):
Change Table Value StarsFound,game.Level,1 to tableCellValue(StarsFound,game.Level,1)+1
Change Attribute self.StarsFound (integer) to tableCellValue (StarsFound,game.Level,1)
When self.StarsFound is greater than or equal to tableCellValue(StarsNeeded,game.Level,1)
.....Unlock the next level
*The Change Attribute statement is needed because you can't directly compare two table cell values in a rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Lets say i need 50 more stars to unlock world 2 again. If i collect 2 stars in level one and and 3 stars in level two, I want world 2 to still be locked and say "45 more stars needed" How can i do this using the code you gave me? Thanks so much for the help so far its really helping my game come along
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User