Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int collision_d = 0, collision_u = 0, collision_l = 0, collision_r = 0;
- for (int x = 0; x < 40; x ++){
- for (int y = 0; y < 24; y ++){
- if (Blocks[x][y]!=0&&Blocks[x][y]!=4&&Blocks[x][y]!=11){
- int collision = 0;
- collision = Collisions(PlayerX,PlayerY,32,32,x*32,y*32,32,32);
- if (collision>0&&x*32<PlayerX&&y*32==PlayerY){
- collision_l = 1;
- }
- if (collision>0&&x*32+32>PlayerX&&y*32==PlayerY){
- collision_r = 1;
- }
- //if (collision>0&&y*32<PlayerY&&x*32>=PlayerX&&PlayerX<=x*32){
- if (collision>0&&y*32+32<=PlayerY){
- collision_u = 1;
- }
- //if (collision!=0&&y*32+32>PlayerY&&x*32>=PlayerX&&PlayerX<=x*32){
- if (collision>0&&PlayerY+32>=y*32&&PlayerX<=x*32+32&&x*32>=PlayerX){
- collision_d = 1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement