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

#1 2013-03-04 20:56:22

echristophy
New Scratcher
Registered: 2013-02-28
Posts: 17

move rather than click?

I want the program to respond when a sprite is moved, not when it's clicked on. Is there a variation to "when [sprite name] clicked" that is "when [sprite name] is moved"?

Thanks.

Offline

 

#2 2013-03-04 21:02:28

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: move rather than click?

Well, no, though depending on how you scripted the sprite you want to know this about, you could figure this out indirectly, or you could make your own system that'd do this for you. So, could I see the scripts of the sprite you want to be "tracking" ?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-03-04 21:11:52

echristophy
New Scratcher
Registered: 2013-02-28
Posts: 17

Re: move rather than click?

The idea is to balance a redox equation. So I have the equation, and I have an electron sprite. I put a red box on the reactant side and an orange box on the product side. Then the student is directed to drag the electron to the correct side of the equaton. The code is

When electron is clicked
If oxidation=1
   If touching color=red
     broadcast incorrect
   If touching color=orange
     broadcast correct
So when the electron is dragged, nothing happens until you click on it again. And that's not quite what I want. I want the "correct" or "incorrect" message to show up when the electron is dropped on the square.

Offline

 

#4 2013-03-05 00:03:02

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: move rather than click?

So you want it when they're touching?

You can use the <touching []?> block in sensing along with the [wait until <>] block to do something after two sprites make contact.

Offline

 

#5 2013-03-05 03:04:10

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: move rather than click?

Well if the sprite was draggable, and you wanted to detect when the sprite had been moved to a new location, you could store the location x y values in variables, then  repeat until the current location does not match the variables, to detect when the sprite has been moved.


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#6 2013-03-06 11:29:38

echristophy
New Scratcher
Registered: 2013-02-28
Posts: 17

Re: move rather than click?

Thanks for all the help! I will be incorporating it into my program.

Offline

 

Board footer