Hello,
Am very new to scratch.
I have sprite '2' which is moving up and down a y-axis in a 'repeat until' control box. Following the repeat until I have a 'stop script'. I want to 'until' to depend on receiving a broadcast from sprite 1 but I have no 'i receive' option.
Should there be one? Is it part of an add on?
I have tried creating a variable that sets to 1 when it receives the broadcast from Sprite 1, then making the 'repeat until' block depend on the variable being set at 1. But this does not stop the script.
Does any of the above make any sense??
Offline
There is no "received [message]?" block, and the Scratch team is not planning to add one at this moment. However, I can't understand what is going wrong with the second problem. Perhaps you could post a picture of the scripts you are using?
Offline
I am a new scratcher so can't add images i don't think. Have attempted to add the code below:
The script to move the sprite:
[scratchblocks]
when gf clicked
go to [x:114 y:118]
repeat until <X=1>
glide 2 secs to x:114 y:-125
glide 2 secs to x:114 y:118
end
stop script
Script to set the variable:
[scratchblocks]
when I receive Fix x
set X to 1
stop script
Cheers for help
Offline
jo3murphy wrote:
I am a new scratcher so can't add images i don't think. Have attempted to add the code below:
The script to move the sprite:when gf clicked go to x: (114) y: (118) repeat until <(X) = [1]> glide (2) secs to x: (114) y: (-125) glide (2) secs to x: (114) y: (118) end stop scriptScript to set the variable:when I receive [Fix x v] set [X v] to [1] stop scriptCheers for help
Remember to add [/scratchblocks] to the end of your scratchblocks.
Where do you change the X variable and broadcast "Fix x"?
Offline