Discuss Scratch

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 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
the 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

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/

Last edited by mstone326 (Jan. 20, 2018 20:44:42)

capitjeff21
Scratcher
39 posts

Dragging Clones?

thanks
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?

Thanks! this is very helpful
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?

scratchmaster114_hi wrote:

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) layers
And make a new topic if you’re still having issues.

Last edited by medians (March 29, 2023 13:10:07)

Powered by DjangoBB