Advertisement
Ulabael

Новый код для создания пути

Jul 23rd, 2022
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         if !instance_position(dmxg, dmyg, oGBuild)
  2.         {
  3.             if fcell == noone
  4.             {
  5.                 fcell = mouse_x div CellWidth + mouse_y div CellWidth * ds_grid_width(global.grid)
  6.                 char = instance_position(mouse_x div CellWidth * CellWidth + 16, mouse_y div CellHeight * CellHeight + 16, oCharPlayer)
  7.             }
  8.             else if fcell != noone and scell == noone and !instance_position(mouse_x, mouse_y, oCharPlayer)
  9.             {
  10.                 scell = mouse_x div CellWidth + mouse_y div CellWidth * ds_grid_width(global.grid)
  11.                 path = find_path(fcell, scell)
  12.                
  13.                 if char != noone and path != noone
  14.                 {
  15.                     with char
  16.                     {
  17.                         path = scrReverseArray(other.path);
  18.                         event_user(0);
  19.                     }
  20.                     char = noone
  21.                 }
  22.             }
  23.             else
  24.             {
  25.                 fcell = noone
  26.                 scell = noone
  27.             }
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement