Help With Tables?
Hello ![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
In my app, i'm using the table system in game salad to make a star system for my game. My star system is close to perfection, besides one big glitch. How my star system works is that you must complete the level in order to gain credit for obtaining the stars. If you collect a star or multiple stars(Max is 3 stars) and die, the stars reset.
Right now, the glitch i am having is this...lets say you complete level 1 with 2 stars. You go back to the level select and decide that you want to go for all 3 stars. Fortunately, if you get, lets say, 1 star and complete the level, the number of stars displayed in the level select does not change from 2, as it should. However, lets say you obtain 3 stars. If you obtain 3 stars in the level and die... the number of stars collected gets reset back to 0 in the level select, which it should not. What should happen is that the star display in the level select is unaffected like the first scenario.
In case you didn't get what i said, whats happening is that my code that says "if my star count is greater than the table's value, than change the table value to the star count" is not working properly. Whats happening is that once my star count is above the table value, the table value will keep on changing regardless if you obtained more stars the 2nd time.
What i need is a line of code that says once the table value is changed, disable the change value attribute so no other changes in the star count can affect it.
I hope this made sense and i hope someone can help me because i'm stumped!
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
In my app, i'm using the table system in game salad to make a star system for my game. My star system is close to perfection, besides one big glitch. How my star system works is that you must complete the level in order to gain credit for obtaining the stars. If you collect a star or multiple stars(Max is 3 stars) and die, the stars reset.
Right now, the glitch i am having is this...lets say you complete level 1 with 2 stars. You go back to the level select and decide that you want to go for all 3 stars. Fortunately, if you get, lets say, 1 star and complete the level, the number of stars displayed in the level select does not change from 2, as it should. However, lets say you obtain 3 stars. If you obtain 3 stars in the level and die... the number of stars collected gets reset back to 0 in the level select, which it should not. What should happen is that the star display in the level select is unaffected like the first scenario.
In case you didn't get what i said, whats happening is that my code that says "if my star count is greater than the table's value, than change the table value to the star count" is not working properly. Whats happening is that once my star count is above the table value, the table value will keep on changing regardless if you obtained more stars the 2nd time.
What i need is a line of code that says once the table value is changed, disable the change value attribute so no other changes in the star count can affect it.
I hope this made sense and i hope someone can help me because i'm stumped!
Comments
If that's not the issue, then post a copy of your rules (e.g. a screenshot) and we can go from there.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User