GameMaker: Studio

GameMaker: Studio

View Stats:
Jittery movement
I am highly confused as to why the below code produces a speed that during decelaration stops and starts. Though the speed does decelerate, it does it in a way that is not smooth. This code refers to multiple objects which were scattered from a point of origin, and now are returning to that point of origin in a way that means they will all converge at the same time.

moveInSpeed = round(point_distance(x,y,originalX,originalY)/100)+1;
move_towards_point(originalX,originalY,moveInSpeed);

Can anybody identify why this produces jittery movement? Thanks in advance
< >
Showing 1-5 of 5 comments
Daynar Feb 3, 2017 @ 2:35pm 
round is causing the issue
SecondDegreePerm Feb 3, 2017 @ 3:49pm 
I tried it without and the same issue arose
JT Feb 4, 2017 @ 12:38pm 
So what's the +1 at the end of the moveInSpeed equation for?
Diveyoc Feb 4, 2017 @ 5:39pm 
Ya, it seems the round and +1 cause the jitters.
I put this code in an object in my game and the motion seems smooth without it.

moveInSpeed = (point_distance(x,y,obj_hero.x,obj_hero.y)/100);
move_towards_point(obj_hero.x,obj_hero.y,moveInSpeed );

With your original code I noticed the jittery movement.
SecondDegreePerm Feb 5, 2017 @ 4:23am 
Thanks for the aid everyone!
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Feb 3, 2017 @ 1:15pm
Posts: 5