Advertisement
Guest User

Untitled

a guest
Sep 11th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(barva == c_green){
  2.     barva = c_red;
  3.     ini_open("test.sav");
  4.    
  5.     ini_write_real("test", string(poradi), 1);
  6.     ini_write_real("test", string(poradi)+"-x", x);
  7.     ini_write_real("test", string(poradi)+"-y", y);
  8.    
  9.     for(var i = -1; i <= 1; i+=2){
  10.         xx = 0; yy = 0;
  11.         if(ini_key_exists("test", string(poradi+i)) && xx == 0 && yy == 0){
  12.             xx = ini_read_real("test", string(poradi+i)+"-x", -1);
  13.             yy = ini_read_real("test", string(poradi+i)+"-y", -1);    
  14.         }
  15.        
  16.         if(xx != 0 && yy != 0){
  17.             x2 = abs(x - xx) / 32;
  18.             y2 = abs(y - yy) / 32;
  19.             vzdalenostX = 0;
  20.             for(s = 0; s <= x2; s++){
  21.                 if(x < xx){
  22.                     show_debug_message("if");
  23.                     if!(position_meeting(x + vzdalenostX, y, obj_pipe)){
  24.                         instance_create(x + vzdalenostX, y, obj_pipe);
  25.                     }
  26.                     if(s == x2 && y2 != 0){
  27.                         vzdalenostY = 0;
  28.                         for(ss = 0; ss <= y2; ss++){    
  29.                             if(y < yy){
  30.                                 if!(position_meeting(x + vzdalenostX, y + vzdalenostY, obj_pipe)){
  31.                                     instance_create(x + vzdalenostX, y + vzdalenostY, obj_pipe);
  32.                                 }
  33.                             } else {
  34.                                 if!(position_meeting(x + vzdalenostX, y - vzdalenostY, obj_pipe)){
  35.                                     instance_create(x + vzdalenostX, y - vzdalenostY, obj_pipe)
  36.                                 }                    
  37.                             }
  38.                             vzdalenostY += 32;
  39.                         }
  40.                     }
  41.                 } else {
  42.                     show_debug_message("else");
  43.                     if!(position_meeting(x - vzdalenostX, y, obj_pipe)){
  44.                         instance_create(x - vzdalenostX, y, obj_pipe);
  45.                     }              
  46.                     if(s == x2 && y2 != 0){
  47.                         vzdalenostY = 0;
  48.                         for(ss = 0; ss <= y2; ss++){    
  49.                             if(y < yy){
  50.                                 if!(position_meeting(x - vzdalenostX, y + vzdalenostY, obj_pipe)){
  51.                                     instance_create(x - vzdalenostX, y + vzdalenostY, obj_pipe);
  52.                                 }  
  53.                             } else {
  54.                                 if!(position_meeting(x - vzdalenostX, y - vzdalenostY, obj_pipe)){
  55.                                     instance_create(x - vzdalenostX, y - vzdalenostY, obj_pipe);
  56.                                 }  
  57.                             }
  58.                             vzdalenostY += 32;
  59.                         }
  60.                     }            
  61.                 }
  62.                 vzdalenostX += 32;
  63.             }
  64.         }    
  65.     }
  66.     ini_close();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement