I need to go to a color forever and I don't know how. Help me
Offline
I think he means he wants the sprite to go to the nearest instance of a specified color
Offline
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.
Offline
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
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
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
never mind, i figured it out
Offline