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

#1 2008-11-01 19:11:49

scratch-o-matic
Scratcher
Registered: 2008-11-01
Posts: 3

How to go to a color

I need to go to a color forever and I don't know how. Help me

Offline

 

#2 2008-11-01 19:23:33

Lanie
Scratcher
Registered: 2008-02-03
Posts: 1000+

Re: How to go to a color

Can you specify a bit more?

Offline

 

#3 2008-11-01 19:31:24

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: How to go to a color

I think he means he wants the sprite to go to the nearest instance of a specified color

Offline

 

#4 2008-11-01 19:34:38

Lanie
Scratcher
Registered: 2008-02-03
Posts: 1000+

Re: How to go to a color

oh

Offline

 

#5 2008-11-01 23:13:09

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: How to go to a color

That is an interesting problem.   I suppose you could make a straight line sensing sprite and spin it around like a search beam...then grow it larger and larger until you hit the color you were looking for.  That would give you the angle, then you set your sprite in that direction and walk until you hit the color.  It might work, but it would be pretty slow.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#6 2008-11-02 08:05:57

deerel
Scratcher
Registered: 2008-08-23
Posts: 89

Re: How to go to a color

Paddle2See wrote:

That is an interesting problem.   I suppose you could make a straight line sensing sprite and spin it around like a search beam...then grow it larger and larger until you hit the color you were looking for.  That would give you the angle, then you set your sprite in that direction and walk until you hit the color.  It might work, but it would be pretty slow.

Wow, interesting ideas. Using full circle instead of a line, multiplying size by two, then binary search to find the distance may be pretty fast, finding the angle is bigger problem to do fast... but if you want to go to nearest, you must find the distance first, not the angle. Rotating line, like one in analog clock, may help, but to be fast, that is not rotating too slowly, and working, that is, not rotating too fast and miss the spot, would involve some of the generally dreaded trigonometry.

Offline

 

#7 2008-11-02 09:04:40

scratch-o-matic
Scratcher
Registered: 2008-11-01
Posts: 3

Re: How to go to a color

I meeant that i am scrolling and i want to go to the color black and be able to move while still touching black

Offline

 

#8 2008-11-02 16:16:04

deerel
Scratcher
Registered: 2008-08-23
Posts: 89

Re: How to go to a color

Still not understood, at least from my part.

Offline

 

#9 2008-11-02 17:31:16

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

Re: How to go to a color

Do you mean that you want gravity to pull you down to platforms that are colored black, and which allow you to move sideways at the same time?

Offline

 

#10 2008-11-04 12:12:49

scratch-o-matic
Scratcher
Registered: 2008-11-01
Posts: 3

Re: How to go to a color

never mind, i figured it out

Offline

 

Board footer