I'm making a rhythm tapping game, and I would like to have a score system where the score is represented by sprites. I don't want my score to look orangish, and I don't want the kind that requires stamping (I have a background sprite). Please help!
Offline
Make a sprite with all numbers between the lower and upper bound of the score as costumes. Like, when the lower bound is 0 and the upper 100, make a sprite with 101 costumes, the first 0, the second 1, the third 2, ..., and the 101st 100.
Then make a script:
<when /> (green flag) clicked>
<forever>
<switch to costume ((score) + 1)>
<end forever>
Did you understand what I mean?
Last edited by meew0 (2010-06-24 06:32:02)
Offline
meew0 wrote:
Make a sprite with all numbers between the lower and upper bound of the score as costumes. Like, when the lower bound is 0 and the upper 100, make a sprite with 101 costumes, the first 0, the second 1, the third 2, ..., and the 101st 100.
Then make a script:
<when /> (green flag) clicked>
<forever>
<switch to costume ((score) + 1)>
<end forever>
Did you understand what I mean?
Yea . . .I did understand . .and thanks, but the scores in my game are gonna be counted by the thousands . . .so I need a better way. Thanks anyways
Offline
You could have a bunch of sprites, 1 per digit displaying your score. Each sprite has 9 costumes, and there's one representing ones, tens, hundreds etc.
Rail guns die by emp bomb a lot...
Offline
LordGaGa wrote:
meew0 wrote:
Make a sprite with all numbers between the lower and upper bound of the score as costumes. Like, when the lower bound is 0 and the upper 100, make a sprite with 101 costumes, the first 0, the second 1, the third 2, ..., and the 101st 100.
Then make a script:
<when /> (green flag) clicked>
<forever>
<switch to costume ((score) + 1)>
<end forever>
Did you understand what I mean?Yea . . .I did understand . .and thanks, but the scores in my game are gonna be counted by the thousands . . .so I need a better way. Thanks anyways
![]()
That would be REALLY hard. Unfortunely variables or stamping are the best way.
Offline
juststickman wrote:
You could have a bunch of sprites, 1 per digit displaying your score. Each sprite has 9 costumes, and there's one representing ones, tens, hundreds etc.
Rail guns die by emp bomb a lot...
Thanks, but I once saw a score system that incorporated lists? I am looking for that one... I don't care how hard it is (I'm not exactly a newbie, I'm just starting again)... I really need it. Your suggestion looks promising, could you explain how that would work? Thanks.
Offline
"Incorporated lists"? I made one that sorted scores into high scores via lists...
high score sorter
Otherwise I am lost, sorry. I thought you were originally asking about how to display a score via sprites?
Last edited by Locomule (2010-06-25 10:07:55)
Offline
Locomule wrote:
"Incorporated lists"? I made one that sorted scores into high scores via lists...
high score sorter
Otherwise I am lost, sorry. I thought you were originally asking about how to display a score via sprites?
Yea . . .that was what I was asking for. The thing is that I once saw a scoreing system which incorporated lists . . .something along the lines of . . .display first digit
or something. Thanks
Offline
juststickman wrote:
You could have a bunch of sprites, 1 per digit displaying your score. Each sprite has 9 costumes, and there's one representing ones, tens, hundreds etc.
Rail guns die by emp bomb a lot...
This is part of what you want. You want as many sprites as their will be digits in the score (so if scores go to 999,999 then you would need 6 sprites) Each of those sprites needs 10 costumes actually the numbers 0 to 9. Use stacked if/else statements to set the costume and then make the last else hide the costume. That way smaller scores will be displayed zeros or junk for the higher digits.
By arranging the sprites in a row on the screen, each one will be used as a digit in the visible score. A sprite for ones, tens, hundreds, etc. Here is where your list comes in. Write the total score to a list (we'll call that list Score.) Make another variable "Length" and set it to the Length of Score (*note* for "Length of" use the green Numbers block, NOT the red Variables List block.)
Almost done, now set the sprite farthest to the right's costume (the 'ones' sprite) to
letter Length of Score ("letter X of X" being another green Numbers block)
Since the variable "Length" = the number of digits in the score, it defaults to the last score digit or the 'ones."
Now set the 2nd from right sprite (the "10s place) to the same thing except use
letter (Length - 1) of Score
and the next sprite (the 100's place) uses Length - 2, etc for the rest. And there you go, now you have a scoring system that uses only sprites and is list-driven and looks like just a cool score readout to the player.
The biggest drawback I see is the need to know how many digits/sprites you will need for say a really high score but you will know that as you tweak and finish the game. Peace!
Last edited by Locomule (2010-06-27 18:29:42)
Offline
Locomule wrote:
juststickman wrote:
You could have a bunch of sprites, 1 per digit displaying your score. Each sprite has 9 costumes, and there's one representing ones, tens, hundreds etc.
Rail guns die by emp bomb a lot...This is part of what you want. You want as many sprites as their will be digits in the score (so if scores go to 999,999 then you would need 6 sprites) Each of those sprites needs 10 costumes actually the numbers 0 to 9. Use stacked if/else statements to set the costume and then make the last else hide the costume. That way smaller scores will be displayed zeros or junk for the higher digits.
By arranging the sprites in a row on the screen, each one will be used as a digit in the visible score. A sprite for ones, tens, hundreds, etc. Here is where your list comes in. Write the total score to a list (we'll call that list Score.) Make another variable "Length" and set it to the Length of Score (*note* for "Length of" use the green Numbers block, NOT the red Variables List block.)
Almost done, now set the sprite farthest to the right's costume (the 'ones' sprite) to
letter Length of Score ("letter X of X" being another green Numbers block)
Since the variable "Length" = the number of digits in the score, it defaults to the last score digit or the 'ones."
Now set the 2nd from right sprite (the "10s place) to the same thing except use
letter (Length - 1) of Score
and the next sprite (the 100's place) uses Length - 2, etc for the rest. And there you go, now you have a scoring system that uses only sprites and is list-driven and looks like just a cool score readout to the player.
The biggest drawback I see is the need to know how many digits/sprites you will need for say a really high score but you will know that as you tweak and finish the game. Peace!
Wow! Thanks! This was exactly what I was looking for! *goes and presses love it on all ur projects "
Offline
LordGaGa wrote:
Locomule wrote:
juststickman wrote:
You could have a bunch of sprites, 1 per digit displaying your score. Each sprite has 9 costumes, and there's one representing ones, tens, hundreds etc.
Rail guns die by emp bomb a lot...This is part of what you want. You want as many sprites as their will be digits in the score (so if scores go to 999,999 then you would need 6 sprites) Each of those sprites needs 10 costumes actually the numbers 0 to 9. Use stacked if/else statements to set the costume and then make the last else hide the costume. That way smaller scores will be displayed zeros or junk for the higher digits.
By arranging the sprites in a row on the screen, each one will be used as a digit in the visible score. A sprite for ones, tens, hundreds, etc. Here is where your list comes in. Write the total score to a list (we'll call that list Score.) Make another variable "Length" and set it to the Length of Score (*note* for "Length of" use the green Numbers block, NOT the red Variables List block.)
Almost done, now set the sprite farthest to the right's costume (the 'ones' sprite) to
letter Length of Score ("letter X of X" being another green Numbers block)
Since the variable "Length" = the number of digits in the score, it defaults to the last score digit or the 'ones."
Now set the 2nd from right sprite (the "10s place) to the same thing except use
letter (Length - 1) of Score
and the next sprite (the 100's place) uses Length - 2, etc for the rest. And there you go, now you have a scoring system that uses only sprites and is list-driven and looks like just a cool score readout to the player.
The biggest drawback I see is the need to know how many digits/sprites you will need for say a really high score but you will know that as you tweak and finish the game. Peace!Wow! Thanks! This was exactly what I was looking for! *goes and presses love it on all ur projects
"
There's a small problem though. When the score is 200, the visual score is 199. And when the score is 1000, the visual is 999. When its 1200, the visual is 0199... Is there a way I can fix this?? Help!!
Last edited by LordGaGa (2010-07-02 07:33:13)
Offline
Funny thing is I pondered on this very system but I never actually used it. But then again, I haven't done a 'signature' full-blown game yet anyway. "presses love on all..." lol thanks but not needed. I'm just some an old geek who loves programming. Besides, I do all kinds of teaching. I used to give guitar lessons and you learn tons of stuff while teaching because you see people try things in ways you'd never dream of. I've learned more about game programing since I've been here than in 25 years worth of other languages, editors, etc. That wyciwyg (code) window is the key, no waiting for compiling, debugging is a breeze. Trust me, this style is the future of programing. Ok, I'm rambling >=P
Offline