Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int grassLimit = height*width/2;
- int grassCount = 0;
- while (grassCount<grassLimit){
- int i = ThreadLocalRandom.current().nextInt(0,height);
- int j = ThreadLocalRandom.current().nextInt(0,width);
- if(matrix[i][j].getGroundType()!= MapTile.GroundType.WATER && matrix[i][j].getGroundType()!= MapTile.GroundType.WATER_DEEP){
- matrix[i][j].getContent().add(new Grass());
- grassCount++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement