Function sign_float_#(in#) var#=in/Abs(in) Return var End Function Global V_x#=0 Global V_y#=0 Function Entity_physics(entity,In_x#,In_y#,V_max#,A_max#,friction#) ;-10 V_x_tmp#=V_x-(friction*d_V_x) If d_V_x_tmp=d_V_x V_x=V_x_tmp Else V_x=0 EndIf EndIf If In_y=0 And V_y<>0 V_y_tmp#=V_y-(friction*d_V_y) If d_V_y_tmp=d_V_y V_y=V_y_tmp Else V_y=0 EndIf EndIf ;acceleration V_x=V_x+A_in_x V_y=V_y+A_in_y ;limiter If V_x>V_in_x And V_in_x>0 V_x=V_in_x EndIf If V_xV_in_y And V_in_y>0 V_y=V_in_y EndIf If V_y