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

#1 2012-05-12 07:13:32

FINGINtest
Scratcher
Registered: 2012-03-26
Posts: 20

help with 'liquid' following drawn path. read description please

so their is a pen sprite following mouse when mouse down draw until not mouse down etc. now I have made a cool lazer out of like 5 red block sprites which each follow previous first one excluding first one, now, i want it to travel up the path drawn by pen(E.G draw straight line when lazer is in contact with that it moves up in same direction). how would I do this?

Offline

 

#2 2012-05-12 07:16:02

FINGINtest
Scratcher
Registered: 2012-03-26
Posts: 20

Re: help with 'liquid' following drawn path. read description please

i've posted it on this account if you need to see it to understand

Offline

 

#3 2012-05-12 09:10:52

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help with 'liquid' following drawn path. read description please

Hmm, that's a puzzler.  Since a line has two ends, do you want the laser to default traveling up or down the line?  What if it is horizontal?

I know it probably isn't helpful, but I've posted some quasi-code below (ignoring the most essential part of course  tongue  )

When gf clicked
forever
if<touching [line color]?>
detect slope of line
point in correct direction
else
default movement
end


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2012-05-12 09:25:40

BomberE
Scratcher
Registered: 2009-08-25
Posts: 60

Re: help with 'liquid' following drawn path. read description please

Here is a project which might help you, feel free to remix.
Link to project


check out my Minecraft Blog!

Offline

 

#5 2012-05-12 11:16:00

FINGIN
Scratcher
Registered: 2010-10-19
Posts: 100+

Re: help with 'liquid' following drawn path. read description please

@MoreGamesNow
the most essential part being detect slope of line?
then yes


Problem officer?       http://trollosphere.legtux.org/wp-content/uploads/2012/01/Troll-Face-4efef98405000.png

Offline

 

#6 2012-05-12 12:09:34

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: help with 'liquid' following drawn path. read description please

You could put a ton of different colored dots around your laser, and based on which dots the laser is touching determine the angle with trig.

The problem with using pen is that a sprite can't sense through other sprites, so if the "following" laser sprites overlap with the leading laser sprite, glitches could easily occur.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer