jorgeibiza
Member
I have a pretty fat problem so to speak I need to know how to move objects or instances of objects by left click, I leave attached image to be understood better because what I really need is once I have selected and caught with the mouse to release it go to the address where I have released it with a fixed speed I hope you can help me, thank you very much in advance.
I leave an image with explain.
I have this code but is not precise and contained many bugs:
xPr = x // no los mueva de este lugar siempre tienen que ir en el lugar antes de alterar el codigo de x e y
yPr = y
x = mouse_x
y = mouse_y
if x == xPr
and y == yPr
{
speed = 0
}else
{
speed = 6 // elige la que quieras
direction = point_direction(xPr,yPr,x,y) // indica que la x e y anterior sean direccionadas con las actuales
}
I leave an image with explain.
I have this code but is not precise and contained many bugs:
xPr = x // no los mueva de este lugar siempre tienen que ir en el lugar antes de alterar el codigo de x e y
yPr = y
x = mouse_x
y = mouse_y
if x == xPr
and y == yPr
{
speed = 0
}else
{
speed = 6 // elige la que quieras
direction = point_direction(xPr,yPr,x,y) // indica que la x e y anterior sean direccionadas con las actuales
}
Attachments
-
101.2 KB Views: 5