Hello, I'm making a screensaver, and how come this script doesn't work?
repeat (180)
go to x: (150) y: (0)
repeat until <<touching [green]> or <touching [edge]>)
move 1 step
stamp
Last edited by coolhogs (2012-08-07 19:35:41)
Offline
Well, since you're putting the
go to x: (150) y: (0)inside the repeat, it's going to do that, move 1 step, stamp, then go back to x: 150. I'm assuming you want this:
go to x: (150) y: (0) repeat until <<touching [#00FF00]?> or <touching [edge v]?>> move (1) steps stamp endor
go to x: (150) y: (0) repeat until <<touching [#00FF00]?> or <touching [edge v]?>> move (1) steps end stamp
Last edited by TorbyFork234 (2012-08-07 19:39:50)
Offline
coolhogs wrote:
I need the repeat (180) thing...
What's the problem then?
Last edited by TorbyFork234 (2012-08-07 19:44:18)
Offline
coolhogs wrote:
There's 2 sprites with this script.
One basically goes to the other.
Can you be a little more specific? Could there be other scripts interfering?
Offline
Ok, the problem is that it's already touching green, either from the other sprite or from it's first stamp, so it's skipping the move 1 step stamp, it's just rotating. If you want it to go to each other (or to the edge), make each a slightly different color and have the touching color block specify the color of the other sprite. If you don't want it to do that please specify what you want it to do.
Last edited by TorbyFork234 (2012-08-07 19:59:58)
Offline
Try this for both (keeping the color change)
when gf clicked go to x:(-150) y:(0) //or 150 clear point in direction (-90) //or 90 (depending on what sprite) repeat (360) stamp turn ccw (1) degrees end go to x:(150) y:(0) turn cw (2) degrees clear wait (0.1) secs //only for the one that start out at x:-150 repeat until <<touching color [#00FF00]?>or<touching [edge v]?>> //put the right color move (1) steps stamp end clearYou can then work your way of that, assuming that that's what you want because you still have not made that clear.
Last edited by TorbyFork234 (2012-08-07 20:28:05)
Offline
coolhogs wrote:
Hello, I'm making a screensaver, and how come this script doesn't work?
repeat (180)
go to x: (150) y: (0)
repeat until <<touching [green]> or <touching [edge]>)
move 1 step
stamp
when gf clicked point in direction (90 v) repeat (180) go to x: (150) y: (0) turn cw (1) degrees repeat until <<touching color [#00ff00]?> or <touching [edge v]?>> move (1) steps end stamp
Last edited by PencilFactory (2012-08-08 10:55:06)
Offline
TorbyFork234 wrote:
Try this for both (keeping the color change)
when gf clicked go to x:(-150) y:(0) //or 150 clear point in direction (-90) //or 90 (depending on what sprite) repeat (360) stamp turn ccw (1) degrees end go to x:(150) y:(0) turn cw (2) degrees clear wait (0.1) secs //only for the one that start out at x:-150 repeat until <<touching color [#00FF00]?>or<touching [edge v]?>> //put the right color move (1) steps stamp end clearYou can then work your way of that, assuming that that's what you want because you still have not made that clear.
Um, I accidentally deleted my copy of that project. (didn't save), so could you upload my copy to Scratch?
Offline
coolhogs wrote:
TorbyFork234 wrote:
Try this for both (keeping the color change)
when gf clicked go to x:(-150) y:(0) //or 150 clear point in direction (-90) //or 90 (depending on what sprite) repeat (360) stamp turn ccw (1) degrees end go to x:(150) y:(0) turn cw (2) degrees clear wait (0.1) secs //only for the one that start out at x:-150 repeat until <<touching color [#00FF00]?>or<touching [edge v]?>> //put the right color move (1) steps stamp end clearYou can then work your way of that, assuming that that's what you want because you still have not made that clear.Um, I accidentally deleted my copy of that project. (didn't save), so could you upload my copy to Scratch?
Offline