I have been 'playing with scratch for a while - with my year 3 children and we have a couple of queries, which I haven't been able to sort out.
1. How can I return the sprite back to the beginning of a program to check whether my edits are working.
2. How can I make different sprites start at the same time - or to follow one after the other without using different starting keys? ie make my name jump/move etc one after qanother?
Many thanks
Mrs G Hollamby
Offline
1. As the first block in your program, have "goto X: Y:", where X and Y are the start coordinates of your sprite. Then whenever your program is run you sprite will start from the same place.
2. There are lots of different ways of begining a script, and so there are many different ways of having scripts start together or start sequentially.
The most efficient, I find, is to use broadcasts.
On your background, you can create a script that consists of
When Green Flag Clicked
Broadcast 'Activate Sprite1" and wait
Broadcast 'Activate Sprite2" and wait
Broadcast 'Activate Sprite3" and wait
etc
Then on each sprite, you can start the scripts with "When I recieve"...
That way, all the sprites which start with "When I receive Activate Sprite1" will activate together. Then, when they have all stopped, the sprites that start with "When I receive Activate Sprite2" will act, etc.
See my "Creation of the World" project for an example.
The only difficulty there is if you want a sprite to act forever, in which case you will cannot use "Broadcast and wait", as it would wait forever.
Instead, you would have to use
"Broadcast Activate Sprite1."
"Wait xxx seconds."
"Broadcast Activate Sprite2."
where xxx is the amount of time you want between activating the first set of sprites and the second.
Offline
1. Thanks, but that just puts the sprite back to where it started, it doesn't re-orientate it back. So, eg. if I have turned it 15 degs. the sprite stays at that angle. The children find it very frustrating when they are trying to work out a program by trial. What do you do when you are building a program?
Offline
teacher1 wrote:
1. Thanks, but that just puts the sprite back to where it started, it doesn't re-orientate it back. So, eg. if I have turned it 15 degs. the sprite stays at that angle. The children find it very frustrating when they are trying to work out a program by trial. What do you do when you are building a program?
So in addition to having a Go To X,Y block as one of your first blocks, also put a Point in Direction xx block so you know it is oriented properly. You may also want to set the costume, the size, any graphic effects and so on. It's important to set the initial state of each sprite so the project can be rerun consistently. There is no automatic way to do it, you need to put blocks in at the start of the project (usually run off the green flag) for each sprite to make sure they are set up properly.
Offline