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

#1 2011-07-26 21:46:30

rowona
Scratcher
Registered: 2009-07-11
Posts: 5

How do you say "from this number to this number in scratch"

I feel like there is some obvious solution I'm missing, but how do you say something like "1 through 10" if I want to broadcast something if one sprite hits any sprite with a name that is is a number one through ten. I hope that makes sense xD

Offline

 

#2 2011-07-26 21:53:43

laptop97
Scratcher
Registered: 2011-06-27
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

I dont know if this is what you mean, but you could maybe do

Start
Forever If <Touching Sprite2>
Broadcast (2)
Wait until <Not<Touching Sprite2>>

Offline

 

#3 2011-07-26 21:53:54

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

if less than number 1 higher than highest. and 1 less than lowest.

Offline

 

#4 2011-07-26 22:03:15

rowona
Scratcher
Registered: 2009-07-11
Posts: 5

Re: How do you say "from this number to this number in scratch"

@laptop97 Not really what I was asking about, thanks though  smile


@ImagineIt Yeah I was thinking that but the script right now is
When green flag clicked
forever if touching 1 or 2 or 3.....all the way to ten.
Broadcast "game lost"

so how could I use the less than/greater than things in that situation?

Offline

 

#5 2011-07-26 23:50:07

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

rowona wrote:

@ImagineIt Yeah I was thinking that but the script right now is
When green flag clicked
forever if touching 1 or 2 or 3.....all the way to ten.
Broadcast "game lost"

so how could I use the less than/greater than things in that situation?

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#6 2011-07-27 08:38:48

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

hmnwilson wrote:

rowona wrote:

@ImagineIt Yeah I was thinking that but the script right now is
When green flag clicked
forever if touching 1 or 2 or 3.....all the way to ten.
Broadcast "game lost"

so how could I use the less than/greater than things in that situation?

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.

Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Offline

 

#7 2011-07-27 10:26:02

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

scimonster wrote:

hmnwilson wrote:

rowona wrote:

@ImagineIt Yeah I was thinking that but the script right now is
When green flag clicked
forever if touching 1 or 2 or 3.....all the way to ten.
Broadcast "game lost"

so how could I use the less than/greater than things in that situation?

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.

Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Does that work online too? I think sprite name exploits like that are broken in the Java player, but I'm not sure.  hmm


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#8 2011-07-27 11:15:43

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

Harakou wrote:

scimonster wrote:

hmnwilson wrote:

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.

Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Does that work online too? I think sprite name exploits like that are broken in the Java player, but I'm not sure.  hmm

Java Player? Meh.

Offline

 

#9 2011-07-27 12:15:35

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

Harakou wrote:

Does that work online too? I think sprite name exploits like that are broken in the Java player, but I'm not sure.

I just tested it, it works in both the Java and Flash players. ^^


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#10 2011-07-27 13:55:50

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

scimonster wrote:

hmnwilson wrote:

rowona wrote:

@ImagineIt Yeah I was thinking that but the script right now is
When green flag clicked
forever if touching 1 or 2 or 3.....all the way to ten.
Broadcast "game lost"

so how could I use the less than/greater than things in that situation?

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.

Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Whoa, I never knew about this  yikes

Thanks, that will help me a lot!


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#11 2011-07-27 14:46:46

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

hmnwilson wrote:

scimonster wrote:

hmnwilson wrote:

I think he though you were talking about a number in general, not a sprite name. Sadly, you can't insert reporter blocks into a "touching" block, so you might have do it that way  hmm

However, depending on what the object of the game is, you could simply give 1-10 a distinctive outline colour and use "touching color" instead. That works, unless the sprites aren't supposed to be distinguishable, in which case you might have to go with the other solution, unfortunately.

Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Whoa, I never knew about this  yikes

Thanks, that will help me a lot!

I'm not sure if that would work. I think sprites count themselves as something that they could "touch" as well, so it would always be true.


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#12 2011-07-27 15:39:20

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

MyRedNeptune wrote:

hmnwilson wrote:

scimonster wrote:


Yes you can put it in!

You can try this, but I don't think it's any shorter:
http://weebly.com/uploads/8/1/3/6/8136364/2298163.gif

Whoa, I never knew about this  yikes

Thanks, that will help me a lot!

I'm not sure if that would work. I think sprites count themselves as something that they could "touch" as well, so it would always be true.

Well, it would be put in a sprite other than Sprite1-10. ;P

Offline

 

#13 2011-07-27 16:27:54

rowona
Scratcher
Registered: 2009-07-11
Posts: 5

Re: How do you say "from this number to this number in scratch"

Thanks everyone; the problem with that, scimonster, is that spritetouching almost immediately just sets to ten, so it only broadcasts game lost for that one sprite. Also I've already named all the sprites the numbers one through ten (without even "sprite" before the name) , so I don't think I need the join ..I'm not sure what that changes though.

Offline

 

#14 2011-07-27 23:24:25

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How do you say "from this number to this number in scratch"

Actually, it doesn't seem to be working for me at all.  hmm

Offline

 

#15 2011-07-28 23:01:15

rowona
Scratcher
Registered: 2009-07-11
Posts: 5

Re: How do you say "from this number to this number in scratch"

I guess my only option is to just do it all out then. Well it won't really take that long, I guess, it just makes it seem kind of... clunky :-/

Offline

 

#16 2011-07-29 12:42:59

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: How do you say "from this number to this number in scratch"

do what scimonster said, but try the Repeat until block, like: Repeat until <(Variable) = 10>


I'm back.
Maybe.

Offline

 

Board footer