I want to display 1, 2 or 3 stars for each level completed by the player (same as on most games). However, I’m having trouble figuring out a streamlined approach. Everything I try is nothing more than ALOT of repetition of code. I would really appreciate any guidance.
the key is to set up your data in an array that can be looped over - that should eliminate the code replication.
another convenience thing i like to do is set up a sprite sequence with: locked,0,1,2,3stars
with an instance of that sprite in each level group, it’s easy to set its frame to indicate the state of that level
(Rob’s tutorial draws stuff manually, but I think that’s only so it’s more stand-alone code, not dependent on images - the concepts are still the same tho)
the key is to set up your data in an array that can be looped over - that should eliminate the code replication.
another convenience thing i like to do is set up a sprite sequence with: locked,0,1,2,3stars
with an instance of that sprite in each level group, it’s easy to set its frame to indicate the state of that level
(Rob’s tutorial draws stuff manually, but I think that’s only so it’s more stand-alone code, not dependent on images - the concepts are still the same tho)