Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool block::checker(int nxloc, int xyloc, const* screen, int deltad = 0){
- if ((dir+deltad)==0 && (xloc+dist_right)<xlen &&
- (xloc-dist_left)>=0 && (yloc+dist_down)>=0){
- for (int y=0;y<5;y++){
- for (int x=0;x<5;x++){
- int absx = (xloc+x)-3;
- int absy = (yloc+y)-3;
- if (blueprint[y][x] && screen[absy][absx] == staticTetrimino){
- return false;
- }
- }
- }
- } else if ((dir+deltad)==1 && (xloc+dist_up)<xlen &&
- (xloc-dist_down)>=0 && (yloc+dist_right)>=0){
- for (int y=0;y<5;y++){
- for (int x=0;x<5;x++){
- int absx = (xloc+x)-3;
- int absy = (yloc+y)-3;
- if (blueprint[x][5-y] && screen[absy][absx] == staticTetrimino){
- return false;
- }
- }
- }
- } else if ((dir+deltad)==2 && (xloc+dist_left)<xlen &&
- (xloc-dist_right)>=0 && (yloc+dist_up)>=0){
- for (int y=0;y<5;y++){
- for (int x=0;x<5;x++){
- int absx = (xloc+x)-3;
- int absy = (yloc+y)-3;
- if (blueprint[5-y][5-x] && screen[absy][absx] == staticTetrimino){
- return false;
- }
- }
- }
- } else if ((dir+deltad)==3 && (xloc+dist_down)<xlen &&
- (xloc-dist_up)>=0 && (yloc+dist_left)>=0){
- for (int y=0;y<5;y++){
- for (int x=0;x<5;x++){
- int absx = (xloc+x)-3;
- int absy = (yloc+y)-3;
- if (blueprint[5-x][5-y] && screen[absy][absx] == staticTetrimino){
- return false;
- }
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement