Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1.             int collision_d = 0, collision_u = 0, collision_l = 0, collision_r = 0;
  2.             for (int x = 0; x < 40; x ++){
  3.                 for (int y = 0; y < 24; y ++){
  4.                     if (Blocks[x][y]!=0&&Blocks[x][y]!=4&&Blocks[x][y]!=11){
  5.                         int collision = 0;
  6.                         collision = Collisions(PlayerX,PlayerY,32,32,x*32,y*32,32,32);
  7.                         if (collision>0&&x*32<PlayerX&&y*32==PlayerY){
  8.                             collision_l = 1;
  9.                         }
  10.                         if (collision>0&&x*32+32>PlayerX&&y*32==PlayerY){
  11.                             collision_r = 1;
  12.                         }
  13.                         //if (collision>0&&y*32<PlayerY&&x*32>=PlayerX&&PlayerX<=x*32){
  14.                         if (collision>0&&y*32+32<=PlayerY){
  15.                             collision_u = 1;
  16.                         }
  17.                         //if (collision!=0&&y*32+32>PlayerY&&x*32>=PlayerX&&PlayerX<=x*32){
  18.                         if (collision>0&&PlayerY+32>=y*32&&PlayerX<=x*32+32&&x*32>=PlayerX){
  19.                             collision_d = 1;
  20.                         }
  21.                     }
  22.                 }
  23.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement