Advertisement
Guest User

randomLevel.java

a guest
Oct 31st, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. package com.morgenmiddag.rain.level;
  2.  
  3. import java.util.Random;
  4.  
  5. public class RandomLevel extends Level {
  6.  
  7. private static final Random random = new Random();
  8.  
  9. public RandomLevel(int width, int height) {
  10. super(width, height);
  11. }
  12.  
  13. protected void genereateLevel() {
  14. for(int y = 0; y < height; y++){
  15. for(int x = 0; x < width; x++){
  16. tiles[x + y * width] = random.nextInt(4);
  17. }
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement