How do I smooth transition to it's place in drag n drop

Get help using Construct 2

Post » Sat Feb 06, 2016 11:41 am

Hello,

I am working on a drag and drop game and need a smooth transition to get sprite back to it's actual place if user drag the sprite to wrong choice.
B
6
Posts: 16
Reputation: 272

Post » Sat Feb 06, 2016 11:52 am

Just remember the starting cords of the object and on object release check if new position is wrong or right. If it is wrong then use lerp function or simply Move at angle. Depends what do you mean by "smooth" :)
Image
B
27
S
14
G
54
Posts: 853
Reputation: 31,110

Post » Sat Feb 06, 2016 12:29 pm

Hi BackendFreak,

Can you write lerp function for me. My sprite actual position is 577, 480 and need to drag it back to it's actual position from 833, 192. I am creating a drag and drop game and when user drag the sprite to wrong choice then sprite get back to its actual position with a smooth transition effect.
B
6
Posts: 16
Reputation: 272

Post » Sat Feb 06, 2016 12:32 pm

BackendFreak wrote:Just remember the starting cords of the object and on object release check if new position is wrong or right. If it is wrong then use lerp function or simply Move at angle. Depends what do you mean by "smooth" :)


Hi BackendFreak,

Can you write lerp function for me. My sprite actual position is 577, 480 and need to drag it back to it's actual position from 833, 192. I am creating a drag and drop game and when user drag the sprite to wrong choice then sprite get back to its actual position with a smooth transition effect.
B
6
Posts: 16
Reputation: 272


Return to How do I....?

Who is online

Users browsing this forum: ErudioLtd, oosyrag, s3eKn, Zjahel0001 and 8 guests