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

#1 2013-02-01 08:18:36

jamsel
New Scratcher
Registered: 2013-02-01
Posts: 1

How to use sprite1 to move another sprite2?

Is it possible to have an instruction that uses an action on one script to result in a command of another script.
Something like: " if sprite1 is clicked then move spritet 2 to xy"?

JAmsel

Offline

 

#2 2013-02-01 11:26:59

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: How to use sprite1 to move another sprite2?

Very possible actually.  smile  Just use scripts similar to this. The first is for sprite 1, the second, is on sprite 2.

When [Sprite 1] Clicked
broadcast [Sprite 2 Move v]
When I receive [Sprite 2 Move v]
go to x: [0] y: [0] //Put in the coords of your choice
go to [Sprite 1 v] //If you want to go to a sprite
glide [1] secs to x: [0] y: [0] //If you want to glide to coords of choice
glide [1] secs to x: ([x position v] of [Sprite 1 v]) y: ([y position v] of [Sprite 1 v])
//If you want to glide to a sprite
Of the four choices of block under the When I receive block, only choose one. The comments say what each one will do. You can change the glide time at will.

Last edited by sonicfan12p (2013-02-01 11:29:32)


Why are the secret organizations getting all the attention?  mad

Offline

 

#3 2013-02-04 12:59:20

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: How to use sprite1 to move another sprite2?

If you download BYOB then it has all the features of scratch in the same places (so you can ignore the more complicated bits) but in control it has a run block. Put the run block on the canvas and go into sensing. get the x position of sprite 1 block and put this in the run block. Next operators, the script, put this in the bit that says x postion and then put what you want the other sprite to do in the 'the script' block, then change the bit that says sprite 1 to whichever sprite that you want to control. This gives you much more versatility than using broadcast.

Offline

 

#4 2013-02-04 13:13:51

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: How to use sprite1 to move another sprite2?

shadowmouse wrote:

If you download BYOB then it has all the features of scratch in the same places (so you can ignore the more complicated bits) but in control it has a run block. Put the run block on the canvas and go into sensing. get the x position of sprite 1 block and put this in the run block. Next operators, the script, put this in the bit that says x postion and then put what you want the other sprite to do in the 'the script' block, then change the bit that says sprite 1 to whichever sprite that you want to control. This gives you much more versatility than using broadcast.

The Help With Scripts forum is for helping people in regular Scratch, not the mods of it. When posting here, try to keep it in line with regular Scratch.


Why are the secret organizations getting all the attention?  mad

Offline

 

Board footer