Check for droppable area empty or not

Get help using Construct 2

Post » Mon Feb 25, 2013 9:33 am

Hi!

How do I check that there's an element in a droppable area, thus preventing other element from being dropped in that filled up droppable area?

Thank you.
B
9
Posts: 44
Reputation: 570

Post » Mon Feb 25, 2013 12:31 pm

hi, here's how i've been doing my drag-drop with overlap checking:

https://dl.dropbox.com/u/52354372/drag_drop_overlap_test.capx

you could also do a simple check for the dragdrop behavior where you store the sprite's position on drag start, then on drop if it's overlapping another object you move back to that stored position.

but i would go with a movement tester sprite like in the example - most games with drag-drop do something similar, & it just feels more intuitive having the preview of where you're moving.

note - i've used a family in my example file for containing all blockable objects, so it might not open in the free version of C2.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Wed Feb 27, 2013 2:43 am

Hi!

Thank you so much for your help. But I can't open the file since I am using a free edition of Construct 2.

Can you explain to me how do you store the sprite's position on drag start, then on drop if it's overlapping another object you move back to that stored position?

Thank you. :)
B
9
Posts: 44
Reputation: 570


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests