Advertisement
ZoriaRPG

Untitled

Dec 13th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. //Two FFCs, one with this script, the other without.
  2.     //The second ffc should be set as the 'Link' to the ffc without
  3.     //the script in the ffc editor.
  4. //When Link collides with the other ffc (np script), he and this ffc (with the
  5. //script), will trade places.
  6.  
  7. ffc script linkswap
  8. {
  9.     void run()
  10.     {
  11.         int lx; int ly;
  12.         while(1);
  13.         {
  14.             ffc otherf = Screen->LoadFFC9this->Link);
  15.             if ( Abs(Link->X - otherf->X) < 8 )
  16.             {
  17.                 if ( Abs(Link->Y - otherf->Y) < 8 )
  18.                 {
  19.                     lx = Link->X;
  20.                     ly = Link->Y;
  21.                     Link->X = this->X;
  22.                     Link->Y = this->Y;
  23.                     this->X = lx;
  24.                     this->Y = ly;
  25.                 }
  26.             }
  27.             Waitframe();
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement