GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2019-10-28 22:46:11

lostdarkwolf
Member
Registered: 2015-11-19
Posts: 24

3 scripts that each determine collision location

I have made a set of scripts that each scan for collision with another instance in a unique way. Each script scans the edge of the local instance, looking for another specified instance. if the other instance is found, you are able to get each end of the collision, as well as the middle of the collision. all of these points can/will also be on the edge of the local instance (if possible). The ends of the collision will always be on the edge of the local instance.
I have made this set of scripts in order to make a raster physics engine. I'm not sure if I can make the engine, but I'll try. If I am successful, it will be a script, and I will post it on gmlscripts.

The first script is collision_edge_scan_first. This script is the fastest, but it also gives the least information. This script should be used if you only need ANY point in the collision of instances, or if you just want to check if two instance borders collide.

The second script is collision_edge_scan_middle. This script only returns the middle point of the collision (optionally on the edge of the local instance).

the last script is collision_edge_scan_region. This script is the slowest, but it also gives the most information. This script is the one that should be used for a physics engine. This script returns the region of collision as well as the middle point of the collision.

There are no required scripts.
EDIT 10/29/2019: Bugfix. Setting edge_correction to false now functions correctly on middle and region scripts.

///collision_edge_scan_first(other_inst, edge_x_start*, edge_y_start*, edge_correction*)
// * arguments are optional
//
// Finds any location on the local instances collision with other_inst, and returns it as variables.
// Edge point arguments are relative to local position.
// The return variables are listed below.
//
// other_inst        The other instance to look for. real (instance id)
// edge_x_start      Optional x-coordinate of any edge point on the sprite. real
// edge_y_start      Optional y-coordinate of any edge point on the sprite. real
// edge_correction   Boolean switch for edge correction. real (bool)
//
// Enable edge correction to ensure that returned points are on an edge of the local instance.
// Supply a correct edge point for faster calculation.
// If an incorrect edge point is supplied, this script will automatically find a correct one.
// Enable line 75 to correct edge points.
//
/// GMLscripts.com/license
/// -- RETURN VARIABLES: --
// ces_ret_x
// ces_ret_y

var var_other_inst, var_edge_x_start, var_edge_y_start, var_edge_x, var_edge_y, 
    var_edge_x_old, var_edge_y_old, var_potential_travel_direction, var_done, 
    var_ret_dist, var_ret_dir, var_edge_correction;
var_other_inst=argument[0];
var_edge_x_start=undefined;
if argument_count>1 var_edge_x_start=x+argument[1];
var_edge_y_start=undefined;
if argument_count>2 var_edge_y_start=y+argument[2];
var_edge_correction=true;
if argument_count>3 var_edge_correction=argument[3];

// find free pixel
var_potential_travel_direction=undefined;
if var_edge_x_start!=undefined {
 if instance_position(var_edge_x_start,var_edge_y_start,id)=id {
  if instance_position(var_edge_x_start,var_edge_y_start-1,id)!=id {
   var_potential_travel_direction=90;
  }
  if instance_position(var_edge_x_start,var_edge_y_start+1,id)!=id {
   var_potential_travel_direction=270;
  }
  if instance_position(var_edge_x_start-1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=180;
  }
  if instance_position(var_edge_x_start+1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=0;
  }
 }
}
if var_potential_travel_direction=undefined {
 // start point is invalid or undefined
 var var_iix=-sprite_xoffset;
 var var_iiy=-sprite_yoffset;
 var var_iix_stop=sprite_width-sprite_xoffset;
 var var_iiy_stop=sprite_height-sprite_yoffset;
 while var_iiy<=var_iiy_stop and var_potential_travel_direction=undefined {
  var var_iix=-sprite_xoffset;
  while var_iix<=var_iix_stop and var_potential_travel_direction=undefined {
   if instance_position(x+var_iix,y+var_iiy,id)=id {
    var_edge_x_start=x+var_iix;
    var_edge_y_start=y+var_iiy;
    var_potential_travel_direction=180;
   }
   var_iix+=1;
  }
  var_iiy+=1;
 }
 if var_potential_travel_direction=undefined {
  if not keyboard_check_direct(ord('Q')) show_message('Crucial error on script "collision_edge_scan_first", Invalid start point, and auto-fix has failed.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
  return 0;
 }
 else {
  //if not keyboard_check_direct(ord('Q')) show_message('Noncrucial error on script "collision_edge_scan_first" used by '+string(object_get_name(object_index))+', Invalid edge start point at '+string(argument[1])+', '+string(argument[2])+'. A valid start point was found at '+string(var_edge_x_start-x)+', '+string(var_edge_y_start-y)+'.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
 }
}

if var_edge_correction!=false {
 ces_ret_x=undefined;
 ces_ret_y=undefined;
 if instance_position(var_edge_x_start,var_edge_y_start,var_other_inst)=var_other_inst {
  ces_ret_x=var_edge_x_start;
  ces_ret_y=var_edge_y_start;
 }
 
 var_edge_x=var_edge_x_start;
 var_edge_y=var_edge_y_start;
 var_done=false;
 while var_done=false {
  var var_ii; var_ii=0;
  while instance_position(var_edge_x+round(lengthdir_x(1,var_potential_travel_direction)),var_edge_y+round(lengthdir_y(1,var_potential_travel_direction)),id)!=id {
   var_potential_travel_direction+=45;
  }
  var_edge_x_old=var_edge_x;
  var_edge_y_old=var_edge_y;
  var_edge_x=var_edge_x+round(lengthdir_x(1.3,var_potential_travel_direction));
  var_edge_y=var_edge_y+round(lengthdir_y(1.3,var_potential_travel_direction));
  if instance_position(var_edge_x,var_edge_y,var_other_inst)=var_other_inst {
   ces_ret_x=var_edge_x;
   ces_ret_y=var_edge_y;
   var_done=true;
  }
  if var_edge_x=var_edge_x_start 
  and var_edge_y=var_edge_y_start {
   var_done=true;
  }
  var_potential_travel_direction=45+point_direction(var_edge_x,var_edge_y,var_edge_x_old,var_edge_y_old);
 }
}
///collision_edge_scan_middle(other_inst, edge_x_start*, edge_y_start*, edge_correction*)
// * arguments are optional
//
// Finds the middle location of the collision with other_inst, and returns it as variables.
// Edge point arguments are relative to local position.
// The return variables are listed below.
//
// other_inst        The other instance to look for. real (instance id)
// edge_x_start      Optional x-coordinate of any edge point on the sprite. real
// edge_y_start      Optional y-coordinate of any edge point on the sprite. real
// edge_correction   Boolean switch for edge correction. real (bool)
//
// Enable edge correction to ensure that returned points are on an edge of the local instance.
// Supply a correct edge point for faster calculation.
// If an incorrect edge point is supplied, this script will automatically find a correct one.
// Enable line 81 to correct edge points.
// Returns -1 if the specified local instance boundary is fully enveloped by other_inst.
//
/// GMLscripts.com/license
/// -- RETURN VARIABLES: --
// ces_ret_x
// ces_ret_y

var var_other_inst, var_edge_x_start, var_edge_y_start, var_edge_x, var_edge_y, 
    var_edge_x_old, var_edge_y_old, var_potential_travel_direction, var_done, 
    var_ret_dist, var_ret_dir, var_points_found, var_edge_correction, var_is_enveloped;
var_other_inst=argument[0];
var_edge_x_start=undefined;
if argument_count>1 var_edge_x_start=x+argument[1];
var_edge_y_start=undefined;
if argument_count>2 var_edge_y_start=y+argument[2];
var_edge_correction=true;
if argument_count>3 var_edge_correction=argument[3];

var_is_enveloped=true;
ces_ret_x=undefined;
ces_ret_y=undefined;
var_points_found=0;

// find free pixel
var_potential_travel_direction=undefined;
if var_edge_x_start!=undefined {
 if instance_position(var_edge_x_start,var_edge_y_start,id)=id {
  if instance_position(var_edge_x_start,var_edge_y_start-1,id)!=id {
   var_potential_travel_direction=90;
  }
  if instance_position(var_edge_x_start,var_edge_y_start+1,id)!=id {
   var_potential_travel_direction=270;
  }
  if instance_position(var_edge_x_start-1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=180;
  }
  if instance_position(var_edge_x_start+1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=0;
  }
 }
}
if var_potential_travel_direction=undefined {
 // start point is invalid or undefined
 var var_iix=-sprite_xoffset;
 var var_iiy=-sprite_yoffset;
 var var_iix_stop=sprite_width-sprite_xoffset;
 var var_iiy_stop=sprite_height-sprite_yoffset;
 while var_iiy<=var_iiy_stop and var_potential_travel_direction=undefined {
  var var_iix=-sprite_xoffset;
  while var_iix<=var_iix_stop and var_potential_travel_direction=undefined {
   if instance_position(x+var_iix,y+var_iiy,id)=id {
    var_edge_x_start=x+var_iix;
    var_edge_y_start=y+var_iiy;
    var_potential_travel_direction=180;
   }
   var_iix+=1;
  }
  var_iiy+=1;
 }
 if var_potential_travel_direction=undefined {
  if not keyboard_check_direct(ord('Q')) show_message('Crucial error on script "collision_edge_scan_middle", Invalid start point, and auto-fix has failed.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
  return 0;
 }
 else {
  //if not keyboard_check_direct(ord('Q')) show_message('Noncrucial error on script "collision_edge_scan_middle" used by '+string(object_get_name(object_index))+', Invalid edge start point at '+string(argument[1])+', '+string(argument[2])+'. A valid start point was found at '+string(var_edge_x_start-x)+', '+string(var_edge_y_start-y)+'.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
 }
}

var_edge_x=var_edge_x_start;
var_edge_y=var_edge_y_start;
var_done=false;
while var_done=false {
 var var_ii; var_ii=0;
 while instance_position(var_edge_x+round(lengthdir_x(1,var_potential_travel_direction)),var_edge_y+round(lengthdir_y(1,var_potential_travel_direction)),id)!=id {
  var_potential_travel_direction+=45;
 }
 var_edge_x_old=var_edge_x;
 var_edge_y_old=var_edge_y;
 if var_edge_x=undefined {
  var_edge_x=var_edge_x_start+round(lengthdir_x(1.3,var_potential_travel_direction));
  var_edge_y=var_edge_y_start+round(lengthdir_y(1.3,var_potential_travel_direction));
 }
 else {
  var_edge_x=var_edge_x+round(lengthdir_x(1.3,var_potential_travel_direction));
  var_edge_y=var_edge_y+round(lengthdir_y(1.3,var_potential_travel_direction));
 }
 if instance_position(var_edge_x,var_edge_y,var_other_inst)=var_other_inst {
  if ces_ret_x!=undefined {
   ces_ret_x+=var_edge_x;
   ces_ret_y+=var_edge_y;
  }
  else {
   ces_ret_x=var_edge_x;
   ces_ret_y=var_edge_y;
  }
  var_points_found+=1;
 }
 else {
  var_is_enveloped=false;
 }
 if var_edge_x=var_edge_x_start 
 and var_edge_y=var_edge_y_start {
  var_done=true;
 }
 
 var_potential_travel_direction=45+point_direction(var_edge_x,var_edge_y,var_edge_x_old,var_edge_y_old);
}

if var_is_enveloped=true {
 ces_ret_x=undefined;
 ces_ret_y=undefined;
 return -1;
}

if var_points_found>0 {
 ces_ret_x=ces_ret_x/var_points_found;
 ces_ret_y=ces_ret_y/var_points_found;
 if var_edge_correction!=false {
  // this finds an edge on a normal vector starting from the 
  //  local position, and facing toward the average point. if 
  //  the local mask is shaped in such a way that the vector
  //  has no collision with the local mask, the return point
  //  will be the average point of all points found.
  var_ret_dist=point_distance(x,y,ces_ret_x,ces_ret_y);
  var_ret_dir=point_direction(x,y,ces_ret_x,ces_ret_y);
 
  var var_ii_dist;
  var_ii_dist=undefined;
  // collision ahead
  if instance_position(ces_ret_x,ces_ret_y,id)!=id {
   var_ii_dist=var_ret_dist;
   while var_ii_dist<=var_ret_dist*2 and instance_position(x+lengthdir_x(var_ii_dist,var_ret_dir),y+lengthdir_y(var_ii_dist,var_ret_dir),id)!=id {
    var_ii_dist+=1;
   }
   if var_ii_dist>var_ret_dist*2 var_ii_dist=undefined;
  }
  // collision here
  else {
   var_ii_dist=point_distance(x,y,ces_ret_x,ces_ret_y);
   var var_stop_dist=distance_to_point(sprite_width,sprite_height);
   while var_ii_dist<=var_stop_dist and instance_position(x+lengthdir_x(var_ii_dist,var_ret_dir),y+lengthdir_y(var_ii_dist,var_ret_dir),id)=id {
    var_ii_dist+=1;
   }
   if var_ii_dist>var_stop_dist var_ii_dist=undefined;
   else var_ii_dist-=1;
  }
  // apply edge finding results to return variables
  if var_ii_dist!=undefined {
   ces_ret_x=round(x+lengthdir_x(var_ii_dist,var_ret_dir));
   ces_ret_y=round(y+lengthdir_y(var_ii_dist,var_ret_dir));
  }
 }
}
///collision_edge_scan_region(other_inst, edge_x_start*, edge_y_start*, edge_correction*)
// * arguments are optional
//
// Finds the end points of the area where the local instance collides with other_inst and returns both points as variables.
// Also finds the middle location of the collision and returns it as variables.
// Edge point arguments are relative to local position.
// The return variables are listed below.
//
// other_inst        The other instance to look for. real (instance id)
// edge_x_start      Optional x-coordinate of any edge point on the sprite. real
// edge_y_start      Optional y-coordinate of any edge point on the sprite. real
// edge_correction   Boolean switch for edge correction. real (bool)
//
// Enable edge correction to ensure that returned points are on an edge of the local instance.
// Supply a correct edge point for faster calculation.
// If an incorrect edge point is supplied, this script will automatically find a correct one.
// Enable line 95 to correct edge points.
// Returns -1 if the specified local instance boundary is fully enveloped by other_inst.
//
/// GMLscripts.com/license
/// -- RETURN VARIABLES: --
// ces_ret_x
// ces_ret_y
// ces_ret_start_x
// ces_ret_start_y
// ces_ret_end_x
// ces_ret_end_y

var var_other_inst, var_edge_x_start, var_edge_y_start, var_edge_x, var_edge_y, 
    var_edge_x_old, var_edge_y_old, var_potential_travel_direction, var_done, 
    var_ret_dist, var_ret_dir, var_points_found, var_edge_correction, var_ii,
    var_is_enveloped;
var_other_inst=argument[0];
var_edge_x_start=undefined;
if argument_count>1 var_edge_x_start=x+argument[1];
var_edge_y_start=undefined;
if argument_count>2 var_edge_y_start=y+argument[2];
var_edge_correction=true;
if argument_count>3 var_edge_correction=argument[3];

var_is_enveloped=true;
ces_ret_x=undefined;
ces_ret_y=undefined;
var_points_found=0;

var_ii=0;
repeat 360 {
 var_empty_region[var_ii]=true;
 var_angle_point_x[var_ii]=undefined;
 var_angle_point_y[var_ii]=undefined;
 var_ii+=1;
}

// find free pixel
var_potential_travel_direction=undefined;
if var_edge_x_start!=undefined {
 if instance_position(var_edge_x_start,var_edge_y_start,id)=id {
  if instance_position(var_edge_x_start,var_edge_y_start-1,id)!=id {
   var_potential_travel_direction=90;
  }
  if instance_position(var_edge_x_start,var_edge_y_start+1,id)!=id {
   var_potential_travel_direction=270;
  }
  if instance_position(var_edge_x_start-1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=180;
  }
  if instance_position(var_edge_x_start+1,var_edge_y_start,id)!=id {
   var_potential_travel_direction=0;
  }
 }
}
if var_potential_travel_direction=undefined {
 // start point is invalid or undefined
 var var_iix=-sprite_xoffset;
 var var_iiy=-sprite_yoffset;
 var var_iix_stop=sprite_width-sprite_xoffset;
 var var_iiy_stop=sprite_height-sprite_yoffset;
 while var_iiy<=var_iiy_stop and var_potential_travel_direction=undefined {
  var var_iix=-sprite_xoffset;
  while var_iix<=var_iix_stop and var_potential_travel_direction=undefined {
   if instance_position(x+var_iix,y+var_iiy,id)=id {
    var_edge_x_start=x+var_iix;
    var_edge_y_start=y+var_iiy;
    var_potential_travel_direction=180;
   }
   var_iix+=1;
  }
  var_iiy+=1;
 }
 if var_potential_travel_direction=undefined {
  if not keyboard_check_direct(ord('Q')) show_message('Crucial error on script "collision_edge_scan_region", Invalid start point, and auto-fix has failed.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
  return 0;
 }
 else {
  //if not keyboard_check_direct(ord('Q')) show_message('Noncrucial error on script "collision_edge_scan_region" used by '+string(object_get_name(object_index))+', Invalid edge start point at '+string(argument[1])+', '+string(argument[2])+'. A valid start point was found at '+string(var_edge_x_start-x)+', '+string(var_edge_y_start-y)+'.#Hold Q to keep this message from showing up. It is advised to hold Q when closing the program as well.');
 }
}
if instance_position(var_edge_x_start,var_edge_y_start,var_other_inst)=var_other_inst {
 ces_ret_x=var_edge_x_start;
 ces_ret_y=var_edge_y_start;
 var_points_found+=1;
 var_empty_region[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]=false;
 if var_angle_point_x[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]!=undefined {
  if point_distance(x,y,var_edge_x_start,var_edge_y_start)>point_distance(x,y,var_angle_point_x[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360],var_angle_point_y[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]) {
   var_angle_point_x[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]=var_edge_x_start;
   var_angle_point_y[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]=var_edge_y_start;
  }
 }
 else {
  var_angle_point_x[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]=var_edge_x_start;
  var_angle_point_y[(round(point_direction(x,y,var_edge_x_start,var_edge_y_start))+720) mod 360]=var_edge_y_start;
 }
}

var_edge_x=var_edge_x_start;
var_edge_y=var_edge_y_start;
var_done=false;
while var_done=false {
 var var_ii; var_ii=0;
 while instance_position(var_edge_x+round(lengthdir_x(1,var_potential_travel_direction)),var_edge_y+round(lengthdir_y(1,var_potential_travel_direction)),id)!=id {
  var_potential_travel_direction+=45;
 }
 var_edge_x_old=var_edge_x;
 var_edge_y_old=var_edge_y;
 if var_edge_x=undefined {
  var_edge_x=var_edge_x_start+round(lengthdir_x(1.3,var_potential_travel_direction));
  var_edge_y=var_edge_y_start+round(lengthdir_y(1.3,var_potential_travel_direction));
 }
 else {
  var_edge_x=var_edge_x+round(lengthdir_x(1.3,var_potential_travel_direction));
  var_edge_y=var_edge_y+round(lengthdir_y(1.3,var_potential_travel_direction));
 }
 if instance_position(var_edge_x,var_edge_y,var_other_inst)=var_other_inst {
  if ces_ret_x!=undefined {
   ces_ret_x+=var_edge_x;
   ces_ret_y+=var_edge_y;
  }
  else {
   ces_ret_x=var_edge_x;
   ces_ret_y=var_edge_y;
  }
  var_points_found+=1;
  var_empty_region[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]=false;
  if var_angle_point_x[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]!=undefined {
   if point_distance(x,y,var_edge_x,var_edge_y)>point_distance(x,y,var_angle_point_x[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360],var_angle_point_y[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]) {
    var_angle_point_x[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]=var_edge_x;
    var_angle_point_y[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]=var_edge_y;
   }
  }
  else {
   var_angle_point_x[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]=var_edge_x;
   var_angle_point_y[(round(point_direction(x,y,var_edge_x,var_edge_y))+720) mod 360]=var_edge_y;
  }
 }
 else {
  var_is_enveloped=false;
 }
 if var_edge_x=var_edge_x_start 
 and var_edge_y=var_edge_y_start {
  var_done=true;
 }
 
 var_potential_travel_direction=45+point_direction(var_edge_x,var_edge_y,var_edge_x_old,var_edge_y_old);
}

if var_is_enveloped=true {
 ces_ret_x=undefined;
 ces_ret_y=undefined;
 return -1;
}

if var_points_found>0 {
 ces_ret_x=ces_ret_x/var_points_found;
 ces_ret_y=ces_ret_y/var_points_found;
 if var_edge_correction!=false {
  // this finds an edge on a normal vector starting from the 
  //  local position, and facing toward the average point. if 
  //  the local mask is shaped in such a way that the vector
  //  has no collision with the local mask, the return point
  //  will be the average point of all points found.
  var_ret_dist=point_distance(x,y,ces_ret_x,ces_ret_y);
  var_ret_dir=point_direction(x,y,ces_ret_x,ces_ret_y);
 
  var var_ii_dist;
  var_ii_dist=undefined;
  // collision ahead
  if instance_position(ces_ret_x,ces_ret_y,id)!=id {
   var_ii_dist=var_ret_dist;
   while var_ii_dist<=var_ret_dist*2 and instance_position(x+lengthdir_x(var_ii_dist,var_ret_dir),y+lengthdir_y(var_ii_dist,var_ret_dir),id)!=id {
    var_ii_dist+=1;
   }
   if var_ii_dist>var_ret_dist*2 var_ii_dist=undefined;
  }
  // collision here
  else {
   var_ii_dist=point_distance(x,y,ces_ret_x,ces_ret_y);
   var var_stop_dist=distance_to_point(sprite_width,sprite_height);
   while var_ii_dist<=var_stop_dist and instance_position(x+lengthdir_x(var_ii_dist,var_ret_dir),y+lengthdir_y(var_ii_dist,var_ret_dir),id)=id {
    var_ii_dist+=1;
   }
   if var_ii_dist>var_stop_dist var_ii_dist=undefined;
   else var_ii_dist-=1;
  }
  // apply edge finding results to return variables
  if var_ii_dist!=undefined {
   ces_ret_x=round(x+lengthdir_x(var_ii_dist,var_ret_dir));
   ces_ret_y=round(y+lengthdir_y(var_ii_dist,var_ret_dir));
  }
 }
}

if var_points_found>0 {
 // find largest free region
 var_ii=0;
 while var_empty_region[var_ii]=true {
  var_ii=(var_ii+1) mod 360;
 }
 var var_current_streak, var_record_streak, var_current_start, var_record_start, var_current_end, var_record_end;
 var_current_streak=0;
 var_record_streak=0;
 var_current_start=var_ii;
 var_record_start=var_ii;
 var_current_end=var_ii;
 var_record_end=var_ii;
 repeat 360 {
  if var_empty_region[var_ii]=true {
   if var_current_streak=0 {
    var_current_start=var_ii;
   }
   var_current_end=var_ii;
   var_current_streak+=1;
  }
  else {
   var_current_streak=0;
  }
  if var_current_streak>var_record_streak {
   var_record_streak=var_current_streak;
   var_record_start=var_current_start;
   var_record_end=var_current_end;
  }
  var_ii=(var_ii+1) mod 360;
 }
 while var_angle_point_x[var_record_start mod 360]=undefined {
  var_record_start=var_record_start-1;
  if var_record_start<0 var_record_start+=360;
 }
 while var_angle_point_x[var_record_end mod 360]=undefined {
  var_record_end=(var_record_end+1) mod 360;
 }
 ces_ret_start_x=var_angle_point_x[var_record_start mod 360];
 ces_ret_start_y=var_angle_point_y[var_record_start mod 360];
 ces_ret_end_x=var_angle_point_x[var_record_end mod 360];
 ces_ret_end_y=var_angle_point_y[var_record_end mod 360];
}

Last edited by lostdarkwolf (2019-10-29 22:34:01)

Offline

Board footer

Powered by FluxBB