DEADSOFTWARE

Add different blocks
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / WorldGen.java
1 package ru.deadsoftware.cavecraft.game;
3 public class WorldGen {
5 private static int[][] foreMap, backMap;
7 static void genWorld(int width, int height) {
8 foreMap = new int[width][height];
9 backMap = new int[width][height];
10 for (int x=0; x<width; x++) {
11 for (int y=height-8; y<height; y++) {
12 if (y==height-8) {
13 foreMap[x][y] = 3;
14 backMap[x][y] = 3;
15 } else if (y<height-4) {
16 foreMap[x][y] = 2;
17 backMap[x][y] = 2;
18 } else {
19 foreMap[x][y] = 1;
20 backMap[x][y] = 1;
21 }
22 }
23 }
24 }
26 static int[][] getForeMap() {
27 return foreMap;
28 }
30 static int[][] getBackMap() {
31 return backMap;
32 }
34 static void clear() {
35 foreMap = null;
36 backMap = null;
37 }
38 }