Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Dragging Clones?
- capitjeff21
-
Scratcher
39 posts
Dragging Clones?
I am trying to make an alpha version of a game I'm creating. I am using scratch for convenience, but I can't drag and drop one clone at a time. I am trying to recreate little alchemy but change it.Here is the script in each sprite so far:
when I start as a clonethe problem is that it still picks up the others, because it only switches picking up to 1 if touching the original, I need it if it is touching the clone
forever
if <touching [ mouse pointer] ?> and <mouse down> then
if <[picking up] = [0]> then
set [ picking up] to [1]
repeat until <not mouse down>
go to mouse pointer
end
end
else
set picking up to 0
end
Last edited by capitjeff21 (Jan. 20, 2018 19:06:06)
- mstone326
-
Scratcher
1000+ posts
Dragging Clones?
You'll need a way to match the clone to drag to their ID (which ID is a ‘for this sprite only’ variable). See if this example helps. You also don't need a forever loop. You can do this with a when this sprite clicked hat block
https://scratch.mit.edu/projects/199053456/
https://scratch.mit.edu/projects/199053456/
Last edited by mstone326 (Jan. 20, 2018 20:44:42)
- greenstudios1234
-
Scratcher
6 posts
Dragging Clones?
To make it easier
when this sprite clicked
go to x: (x) y: (y)
create clone of [ myself v]
when I start as a clone
go to x: (different x) y: (different y)
set drag mode: dragable
- scratchmaster114_hi
-
Scratcher
2 posts
Dragging Clones?
However cant you just make it be in the same x and y without having to change them? you can just make the clone go foreword one layer?
- medians
-
Scratcher
1000+ posts
Dragging Clones?
However cant you just make it be in the same x and y without having to change them? you can just make the clone go foreword one layer?Well, don’t necropost, but you can just do this:
go back (-1) layersAnd make a new topic if you’re still having issues.
Last edited by medians (March 29, 2023 13:10:07)
- Discussion Forums
- » Help with Scripts
-
» Dragging Clones?