Guest User

Untitled

a guest
May 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public void randomLevel() {
  2. Random rand = new Random(System.currentTimeMillis());
  3. for(int i=0;i<map.length;i++) {
  4. for(int j=0;j<map.length;j++) {
  5. int val = rand.nextInt(21);
  6. System.out.println(val);
  7. if(val<4)
  8. map[i][j] = new Wall(i,j);
  9. if(val>=4)
  10. map[i][j] = new Floor(i,j,null);
  11. if(val>17)
  12. map[i][j] = new Floor(i,j, new Gem());
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment