Guest User

Untitled

a guest
Jan 5th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(!place_meeting(x,y,other)) exit;
  2. var g;
  3. g=0;
  4. if(id>other.id)
  5. {
  6.     dir=point_direction(x,y,other.x,other.y);
  7.     force=((lengthdir_x(1,dir)*hspeed)+(lengthdir_y(1,dir)*vspeed))*varMass;
  8.     with(other)
  9.     {
  10.         dir=point_direction(x,y,other.x,other.y);
  11.         force=((lengthdir_x(1,dir)*hspeed)+(lengthdir_y(1,dir)*vspeed))*varMass;
  12.         motion_add(dir,-(force+other.force)/varMass);
  13.     }
  14.     motion_add(dir,-(force+other.force)/varMass);
  15.     while(place_meeting(x,y,other) and g<100)
  16.     {
  17.         x-=lengthdir_x(1/varMass,dir);
  18.         y-=lengthdir_y(1/varMass,dir);
  19.         g+=1;
  20.         with(other)
  21.         {
  22.             x-=lengthdir_x(1/varMass,dir);
  23.             y-=lengthdir_y(1/varMass,dir);
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment