Here is the logic chain here
1) locate a vector that points from the player to 0-Y'
2) move along the vector till the player is as close as possible to 0-Y
3) snap the player to 0-Y

secondary logic
1) do not move along the vector unless landing
2) stop the move if landed

logic of the code
1) define vectors
VECTOR vec_temp
Vector vec_temp2

2) set vector to my location
vec_set(vec_temp,my.x)

3) get a abs vector to 0-Y
vec_diff(vec_temp2,nullvector,vec_temp);

4) change the vector length without changing it's direction to get a speed along the direction vec
vec_normilize(vec_temp2,5*time_step);

5) set a lock
if(vec_dist(my.y,vec_temp2.y)>5)

6)move along the direction at speed 5*time_step, along the abs vec
c_move(my,nullvector,vector(0,vec_temp2.y,0),GLIDE);

7) snap to the 0-Y ( step-5 if is now false)
vec_set(vector(0,my.y,0),nullvector);


Last edited by Malice; 08/02/15 16:37.