Discuss Scratch

Miss_Smiley
Scratcher
11 posts

Dress Up games

I am making this really cool dress-up game for my OC and it's going well but… I really want the clothes to drag onto the character but they won't. I really need some help!!!
deck26
Scratcher
1000+ posts

Dress Up games

I'm assuming you have basic drag and drop working? If not add this to the clothes sprites

whenthisspriteclickedrepeatuntilnotmousedown?gotomouse-pointer

When you have that working the next problem is probably to snap the clothes to the right position if close enough to the character. That should just be a case of having the costume centres set properly. For a dress the sprite can be told to go to the character - tweak the dress costume centre so that that means it is lined up correctly. For a top you probably want to do something like

gotox:x-positionofcharacter +5y:y-positionofcharacter +50 tweak the values you add to get a fit
If the dress item isn't close enough to the character you probably put it back at its starting position.
peppermintpatty5
Scratcher
1000+ posts

Dress Up games

With drag and drop, you can make the clothes follow the mouse when dragged by the mouse and then snap to the character when the mouse button is released. Here is the script that follows this logic:
whenthisspriteclickedrepeatuntilnotmousedown?gotomouse pointerifdistancetotorso<8gototorsosnap to character if it is pretty close to itelsegotowardrobeif it is too far away, put it back where it came from
Hope this helps!

Last edited by peppermintpatty5 (May 25, 2015 13:58:14)

deck26
Scratcher
1000+ posts

Dress Up games

You could just use ‘distance to character’ rather than looking at x and y separately.
peppermintpatty5
Scratcher
1000+ posts

Dress Up games

deck26 wrote:

You could just use ‘distance to character’ rather than looking at x and y separately.
Yep, the substitution for the pythagorean theorem that I always forget exists!
Yeah, I should have used distance(detects in a circular area) instead of a x,y positions(which detects in a rectangular area). I wasn't thinking clearly.
ItzSpongyTime
Scratcher
13 posts

Dress Up games

Just tap on the clothes and check off:
Draggable in game.
Hope I helped
peppermintpatty5
Scratcher
1000+ posts

Dress Up games

ItzSpongyTime wrote:

Just tap on the clothes and check off:
Draggable in game.
Hope I helped
This topic is fairly old, try not to necropost

Powered by DjangoBB