This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-06-24 06:06:16

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Need Help With Scoring System

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!


http://i46.tinypic.com/dr2eu1.png

Offline

 

#2 2010-06-24 06:31:47

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Need Help With Scoring System

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)


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#3 2010-06-24 08:39:21

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

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  big_smile


http://i46.tinypic.com/dr2eu1.png

Offline

 

#4 2010-06-24 08:41:55

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Need Help With Scoring System

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...


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#5 2010-06-24 11:36:16

Red-dino
Scratcher
Registered: 2010-06-08
Posts: 48

Re: Need Help With Scoring System

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  big_smile

That would be REALLY hard. Unfortunely variables or stamping are the best way.


http://i45.tinypic.com/28slsmo.png
helper  big_smile

Offline

 

#6 2010-06-25 09:19:31

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

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.


http://i46.tinypic.com/dr2eu1.png

Offline

 

#7 2010-06-25 10:04:39

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Need Help With Scoring System

"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)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#8 2010-06-26 01:23:50

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

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


http://i46.tinypic.com/dr2eu1.png

Offline

 

#9 2010-06-27 18:26:24

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Need Help With Scoring System

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)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#10 2010-07-02 05:48:30

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

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  big_smile "


http://i46.tinypic.com/dr2eu1.png

Offline

 

#11 2010-07-02 07:00:32

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

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  big_smile "

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)


http://i46.tinypic.com/dr2eu1.png

Offline

 

#12 2010-07-02 09:38:28

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

I really need answers...I'm almost done...I just need to fix the scoring system...


http://i46.tinypic.com/dr2eu1.png

Offline

 

#13 2010-07-02 10:27:58

LordGaGa
Scratcher
Registered: 2010-04-25
Posts: 37

Re: Need Help With Scoring System

Oh! I get it! The costumes has to be from 1 to 0! I was doing 0 - 9 . . . . .thanks!


http://i46.tinypic.com/dr2eu1.png

Offline

 

#14 2010-07-02 10:42:36

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Need Help With Scoring System

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


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer