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

#1 2010-07-02 20:43:04

Greentabby55
Scratcher
Registered: 2010-05-04
Posts: 50

I have a problem.

In my project, I have a red line being drawn, and while it's being drawn, it's intersecting with a blue line. I'm making it so it stops when it hits the blue line, so I made it say

<repeat until><touching color[ blue
   <move( 1 )steps>
<end>

Whenever I try the script, the red line just passes the blue line. What am I doing wrong?

Offline

 

#2 2010-07-02 20:54:12

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: I have a problem.

I think the issue is that it's drawing its own colour on the line before it senses the other colour... Try finding a workaround  smile

EDIT: I found this solution to be suitable:
http://i50.tinypic.com/2vk15qt.gif

Offline

 

#3 2010-07-02 20:58:10

icypenguinis
New Scratcher
Registered: 2010-06-22
Posts: 9

Re: I have a problem.

Are you drawing both lines at the same time? If so, the red may pass the intersection point before the blue reaches it. Is the red line horizontal or vertical?

Offline

 

#4 2010-07-02 21:06:34

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

Re: I have a problem.

Coolstuff's solution works well, but as long as the blue line isn't being drawn by the pen (it is a static image), you can just use your current script, but make the blue line a sprite instead of part of the background. That worked for me.

EDIT: I looked at the project; guess my solution doesn't work in this case.  hmm

Last edited by Harakou (2010-07-02 21:44:12)


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

 

#5 2010-07-02 21:16:06

Greentabby55
Scratcher
Registered: 2010-05-04
Posts: 50

Re: I have a problem.

Thanks

Here's the project, incase you wanted to see it.
http://scratch.mit.edu/projects/Greentabby55/1168163

Offline

 

Board footer