Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sc_Depth
  2.  
  3. //Create Grid
  4. with (O_Depth)
  5. {
  6.  if (!ds_exists(Ds_DepthGrid,ds_type_grid))
  7.  {
  8.   Ds_DepthGrid = ds_grid_create(2, 1);
  9.    Ds_DepthGrid[# 0, 0] = other;
  10.     Ds_DepthGrid[# 1, 0] = other.y;
  11.  
  12.  
  13.  
  14.  
  15.  }
  16.  
  17.   else
  18.   {
  19.   var Hg = ds_grid_height(Ds_DepthGrid) ;
  20.    ds_grid_resize(Ds_DepthGrid, 2, Hg+1);
  21.    
  22.    Ds_DepthGrid[# 0, Hg] = other;
  23.    
  24.     Ds_DepthGrid[# 1, Hg] = other.y;
  25.   }
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32. O_Text
  33.  
  34. Create:
  35.  Ds_DepthGrid = 0;
  36.  
  37. Draw:
  38.  
  39. if ds_exists(Ds_DepthGrid, ds_type_grid)
  40.  {
  41.  ds_grid_sort(Ds_DepthGrid, 1, true);
  42.  
  43.  
  44.  
  45.   for (var yy = 0; yy < ds_grid_height(Ds_DepthGrid);  yy += 1;)
  46.   {
  47.     var Check = Ds_DepthGrid[# 0,yy];
  48.      with Check
  49.      {
  50.      draw_self();
  51.      }
  52.    
  53.      
  54.    
  55.    
  56.  
  57.  
  58.   }
  59.  
  60.  
  61.  ds_grid_destroy(Ds_DepthGrid);
  62.  }
  63.  
  64.  
  65.  
  66.  
  67.  
  68. Game End:
  69. if (ds_exists(Ds_DepthGrid, ds_type_grid))
  70. {
  71. ds_grid_destroy(Ds_DepthGrid);
  72. }
  73.  
  74.  
  75.  
  76. Object O_Check_Depth
  77.  
  78. Draw:
  79. /// @desc Work
  80. //MINDLESS COMMENTS ARE EVERY WHERE TO MUCH FLUFF
  81. //NEEDS TO BE EVEN MORE CLOSTERPHOPIC! (WHY ARE THERE SO MAIN TABS IT ANNOYING)
  82.  
  83. Pre Draw:
  84. Sc_Depth();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement