MartinK12
Member
I'm working in GMS2 on simple code than will move object 100px left when clicked and I want this move to be slow.
I don't want to use alarms and I think simple for should do it but it's not working - object is moving instantly to position = x - 100px, and I want to move it slowly.
My understanding of this code is that it should take 480 steps and game is set to 60 steps so it should work for 8 seconds and not instantly. How to make this work without alarms?
I don't want to use alarms and I think simple for should do it but it's not working - object is moving instantly to position = x - 100px, and I want to move it slowly.
Code:
if clicked
{
for (i = 480; i > 0; i = i - 1)
{
x = x - 0.25;
}
clicked = false;
}