Hello everyone
How do I implement this code shown in this example into Construct 2 ?
I tried to use event "every tick move sprite at angle (sprite.x,sprite.y,mouse.x,mouse.y) a distance of 300*dt" and when the sprite reaches the mouse position it vibrates, i need to create the same smooth movement with easing reach as shown in the example.
Thanks.
function gameLoop(){
var xDistance = mouseX - ship.x;
var yDistance = mouseY - ship.y;
var distance = Math.sqrt(xDistance * xDistance + yDistance * yDistance);
if (distance > 1) {
ship.x += xDistance * easingAmount;
ship.y += yDistance * easingAmount;
}
}