Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (w >=8 && w<=9){
- int randomX=(int)Math.round(Math.random()*(width-11)+4);
- int randomY=(int)Math.round(Math.random()*(height-11)+4);
- if (tiles[randomX][randomY]== Tile.DOOR){
- if (tiles[randomX+1][randomY]== Tile.FLOOR||tiles[randomX+1][randomY]== Tile.FIRSTFLOOR){
- randomX=randomX-3;
- }
- else if (tiles[randomX-1][randomY]== Tile.FLOOR||tiles[randomX-1][randomY]== Tile.FIRSTFLOOR){
- randomX=randomX+1;
- }
- else break;
- int z=0;
- for (int x =0;x<3;x++){
- for (int y=0; y<1;y++){
- if (tiles[randomX+x][randomY+y] == Tile.WALL){
- z++;
- }
- }
- }
- if (z==3){
- for (int x =0;x<3;x++){
- for (int y=0; y<1;y++){
- tiles[randomX+x][randomY+y] = Tile.FLOOR;
- }
- }
- tiles[randomX+3][randomY]= Tile.DOOR;
- tiles[randomX-1][randomY]= Tile.DOOR;
- tiles[randomX+1][randomY-1]= Tile.DOOR;
- tiles[randomX+1][randomY+1]= Tile.DOOR;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement