Move Objects With Your Mouse

M

MUZZY

Guest
In my game, you basically pick up objects with your mouse and throw them away. I tried to create a rope joint between the object and the mouse pointer, but it only allows me to move it around, and when i delete the joint, the acceleration that it used to have doesn't affect it.

Is there any way you can find out the acceleration of the object, and than apply it to it again? I will be very grateful...
 

jazzzar

Member
show us some code to be able to help you,anyway, i will try to help with no code at all, save the acceleration of the object before destroying the rope and after destroying it add that acceleration to the object
 

GewoonNiels

Member
Use the xprevious and yprevious variables.
The direction of the moving object would be: point_direction(xprevious,yprevious,x,y)
And the speed would be: point_distance(xprevious,yprevious,x,y)

Use the above code at the moment when you release the object, and apply all physics afterwards
 
Top