Pages: 1
Topic closed
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
i've posted it on this account if you need to see it to understand
Offline
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 )
When gf clicked forever if<touching [line color]?> detect slope of line point in correct direction else default movement end
Offline
Here is a project which might help you, feel free to remix.
Link to project
Offline
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.
Offline
Topic closed
Pages: 1