Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Mouse Click
- scratchFST
- Scratcher
11 posts
Mouse Click
I know how to do it, but I have a project where you drag things.When you touch something else when you are press another thing, it follows your mouse too. Is there any way that I can fix it? Thanks!
- scubajerry
- Scratcher
1000+ posts
Mouse Click
Put this in all of your sprites. I tested it and it works.
This is the same if you like it better
when green flag clicked
forever
wait until <mouse down?>
repeat until <(not(touching [mouse-pointer v])) or (not(mouse down?)>
go to [mouse-pointer v]
end
wait until <not(mouse down?)>
end
This is the same if you like it better
when green flag clicked
forever
wait until <mouse down?>
repeat until <not((touching [mouse-pointer v]) and (mouse down?))>
go to [mouse-pointer v]
end
wait until <not(mouse down?)>
end
Last edited by scubajerry (April 10, 2014 01:29:55)
- Alberknyis
- Scratcher
1000+ posts
Mouse Click
when (green flag v) //category=events
forever
if <mouse down?> then
if <touching [mouse pointer v]?> then
repeat until <not <mouse down?>>
go to [mouse-pointer v]
end
else
wait until <not <mouse down?>>
end
end
end
stop [all v] ::stack
- Discussion Forums
- » Help with Scripts
- » Mouse Click