S
Seth Davis
Guest
I am working on a simple way to smoothly move between screens in my game. I want to have an object, that when clicked, will smoothly transition the camera from one side to the other. However, with my current code, it instead jerks the camera to the other side instantly, with no smooth transition. It looks correct to me, if anyone could tell me what is wrong with it, that would be fantastic!
side is created in the create event.
and clicked() is simply testing if it was clicked.
I also tried this code with a form of a for loop, and it did the same.
Code:
if (clicked())
{
if (side == 0)
{
side = 2;
while (obj_camera.x < 1536) obj_camera.x += 0.001;
side = 1;
}
else if (side == 1)
{
side = 2;
while (obj_camera.x > 512) obj_camera.x -= 0.001;
side = 0;
}
}
and clicked() is simply testing if it was clicked.
I also tried this code with a form of a for loop, and it did the same.