Hello for a script I'm working on, I'm trying to move an element to the middle of the screen. I've managed to do that, however now I'd like to move over a duration instead of just instantly zooming to the destination. I'm still learning code so not entirely sure how to solve this problem.
My current code is as follows;
Skills.[]Object is the sprite/bitmap that is being moved, currentButtonX/Y is the current location of the bitmap.
Let's say for example I wanted to move the bitmap 200 pixels up over a 60 frame duration. How would I achieve this?
My current code is as follows;
Code:
for (var i = 0; i < Skills.length; i++) {
var a = 762;
var b = currentButtonX;
var c = a - b;
Skills[i].Object.x = Number(Skills[i].Object.x) + c;
Skills[i].X = Number(Skills[i].X) + c;
};
for (var i = 0; i < Skills.length; i++) {
var a = Graphics.height / 2;
var b = currentButtonY;
var c = a - b;
Skills[i].Object.y = Number(Skills[i].Object.y) + c;
Skills[i].Y = Number(Skills[i].Y) + c;
};
Skills.[]Object is the sprite/bitmap that is being moved, currentButtonX/Y is the current location of the bitmap.
Let's say for example I wanted to move the bitmap 200 pixels up over a 60 frame duration. How would I achieve this?
)