Hi I have a game where each level can be obtained maximum 3 stars, I have a select level 15 missions.
I have a meter to tell how many stars have earned at all levels. For example 5/45 stars.
I have a global variable: stars
As I can do this?
statham - I don't know exactly what you are asking, but keeping global variable for total "stars" is fine. If you want to keep info of how many stars for each level, then you should probably use an array for simplicity.
I want to do the last thing you said, but it's complicated?
No it is easy. You need a 1D array. Each value represents the stars earned in the level.
X axis of the array ->
2, 1, 3, 2, 0, 3, 2, 3, ..
https://www.scirra.com/tutorials/307/ar ... ers/page-1
If you want simplicity,use global variables
how it works with global variable? example pls
Doc Ai statham - if you only have a few levels, then you can just use a few global variables (like level1_stars, level2_stars, etc). So, you mentioned 15 levels total in the above post, so maybe that is okay. But for future games with more levels, I would recommend using arrays.
Yeah.Time to learn arrays.
https://www.scirra.com/tutorials/311/level-select if this is what you want?
Level Select with Star system
scirra.com/tutorials/311/level-select if this is what you want? Level Select with Star system
scirra.com/tutorials/311/level-select if this is what you want?
The level select I have it, what I want is that the level select screen, put the total number of stars that each world. For example I have 5 stars / 45 total stars collected.
I was told to use global variable but not join it with set text... some example code
helpp
Hello my experience isn't that great but I will try and figure it out and let you know, let hope so
Can you help me?
Develop games in your browser. Powerful, performant & highly capable.
I keep hoping this helps someone