Sprites snap back to self location

Get help using Construct 2

Post » Wed Oct 16, 2013 9:37 pm

Hello,

I have a question. How do I make tile 1 pop or snap back to the start location when drop or on collision with 2 from my example? Here is my example.

Thanks for the help,

John
B
19
S
4
G
2
Posts: 37
Reputation: 2,494

Post » Wed Oct 16, 2013 9:48 pm

I'm on mobile so I cant look at the capx, but I'd use instance variables. Give the object(s) 2 variables: snapx and snapy. Set those values when you want them to be set. On Created, On Drag Drop Start, etc. then when it meets your conditions for snapping, stop the object dragging and set the position to those variables.

Hopefully this makes sense. If not, I can make an example when I get home.
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Wed Oct 16, 2013 10:00 pm

Thanks for the reply! Can I use family variables for each sprite? an example would be helpful, and thanks for the help.

John
B
19
S
4
G
2
Posts: 37
Reputation: 2,494

Post » Wed Oct 16, 2013 11:59 pm

Here's the example using families. Enjoy :)
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Thu Oct 17, 2013 12:30 am

Thanks for the help!
B
19
S
4
G
2
Posts: 37
Reputation: 2,494


Return to How do I....?

Who is online

Users browsing this forum: jojomickymack and 54 guests