lock drag drop sprite

Get help using Construct 2

Post » Thu Dec 04, 2014 12:23 pm

I am creating an application that should work like this: there sprites with drag drop behavior. And the screen there sprties the square, where to place the sprites with drag drop, when put in the right sprite wanted to lock them with drag drop on the screen
B
3
Posts: 4
Reputation: 183

Post » Thu Dec 04, 2014 2:36 pm

on drop
if sprite1 overlaps sprite2
sprite1 set position to spirte2
sprite1 set drag&drop disabled
Image
B
76
S
28
G
12
Posts: 515
Reputation: 12,409

Post » Thu Dec 04, 2014 4:20 pm

I need the lock happens when a sprite is on top of another
B
3
Posts: 4
Reputation: 183

Post » Thu Dec 04, 2014 9:54 pm

so just use the condition: isOverlapping

or you can check the distance between them

if distance(sprite1.x,sprite1.y,spirte2.x,spirte2.y) < 20
Image
B
76
S
28
G
12
Posts: 515
Reputation: 12,409


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair and 60 guests