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

#1 2010-11-24 12:13:33

Brojangles
New Scratcher
Registered: 2010-11-23
Posts: 4

Displaying score ranks with a sprite

I've made a text sprite with 10 or so costumes which I scripted it to change to when the score is a certain value (eg: score is 60, sprite changes to 'decent') but I can't seem to get it to work.
Currently I have it so that the sprite remains hidden until the end screen, then when it receives the 'end of game' broadcast which comes up after a time, then having an IF Score = X - Y switch to costume B, listed with costumes for certain number brackets.
The score sprite just remains on the default costume, as if there were no scripts.

Offline

 

#2 2010-11-24 13:33:30

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: Displaying score ranks with a sprite

Use this format:

<if><(  Score <<> 10 )>
...Change Costume to:

<else>

<if> <(  Score <<> 20 )>
...Change costume to:

<else>

<if> <( Score <<> 30 )>
...Change costume to:


And so on. This should work nicely.

Last edited by TheSaint (2010-11-24 13:34:02)

Offline

 

#3 2010-11-24 15:21:57

Brojangles
New Scratcher
Registered: 2010-11-23
Posts: 4

Re: Displaying score ranks with a sprite

Thanks.

Offline

 

#4 2010-11-24 20:26:56

S65
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Displaying score ranks with a sprite

TheSaint wrote:

Use this format:
(snip)
And so on. This should work nicely.

But it's inefficient.  sad

Are you changing the costume every multiple of 10 (or any other certain number)? And are the costumes in order? In that case:

Code:

switch to costume (score/10)

Though if you aren't changing at multiples then you might have to go with Saint's method. Or just add redundant costumes (but that might be even more inefficient, idk, depends on whether you care about project size or not).

Last edited by S65 (2010-11-24 20:31:11)

Offline

 

Board footer