SHARE
TWEET

draw_depth

a guest Oct 22nd, 2017 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// @arg instance
  2. /// @arg optional
  3.  
  4. var list = ds_list_create();
  5. for ( var i = 0; i < argument_count; i ++; ){
  6. with ( argument[i] ){
  7. ds_list_add(list,id);
  8. }
  9. }
  10.  
  11. var list_size = ds_list_size(list);
  12.  
  13. if ( list_size > 0 ){
  14.    
  15. var depth_priority = ds_priority_create();
  16.  
  17. for ( var i = 0; i < list_size; i ++; ){
  18. with ( list[| i] ){
  19. ds_priority_add(depth_priority,id,depth);
  20. }
  21. }
  22.  
  23. var size = ds_priority_size(depth_priority);
  24.  
  25. repeat(size){
  26. with ( ds_priority_find_max(depth_priority) ){
  27. draw_self();
  28. ds_priority_delete_max(depth_priority);
  29. }
  30. }
  31.  
  32. ds_priority_destroy(depth_priority);
  33. ds_list_destroy(list);
  34.  
  35. }
  36. else{
  37.    
  38. ds_list_destroy(list);
  39.    
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top