@Override
public void create () {
+ setScreen(new GameScreen());
}
}
\ No newline at end of file
--- /dev/null
+package ru.deadsoftware.cavecraft;
+
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Screen;
+import ru.deadsoftware.cavecraft.game.GameRenderer;
+
+public class GameScreen implements Screen {
+
+ private GameRenderer renderer;
+
+ public GameScreen() {
+ renderer = new GameRenderer();
+ }
+
+ public static int getWidth() {
+ return Gdx.graphics.getWidth();
+ }
+
+ public static int getHeight() {
+ return Gdx.graphics.getHeight();
+ }
+
+ @Override
+ public void show() {
+
+ }
+
+ @Override
+ public void render(float delta) {
+ renderer.render();
+ }
+
+ @Override
+ public void resize(int width, int height) {
+
+ }
+
+ @Override
+ public void pause() {
+
+ }
+
+ @Override
+ public void resume() {
+
+ }
+
+ @Override
+ public void hide() {
+
+ }
+
+ @Override
+ public void dispose() {
+
+ }
+}
--- /dev/null
+package ru.deadsoftware.cavecraft.game;
+
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.graphics.GL20;
+import com.badlogic.gdx.graphics.OrthographicCamera;
+import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
+import com.badlogic.gdx.graphics.Color;
+import ru.deadsoftware.cavecraft.GameScreen;
+
+public class GameRenderer {
+
+ private OrthographicCamera camera;
+ private ShapeRenderer shapeRenderer;
+
+ public GameRenderer() {
+ Gdx.gl.glClearColor(0f,.8f,.8f,1f);
+ }
+
+ public void render() {
+ Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
+
+ }
+
+}
--- /dev/null
+package ru.deadsoftware.cavecraft.game;
+
+public class GameWorld {
+
+ private final int WIDTH, HEIGHT;
+ private int[][] foreMap;
+ private int[][] backMap;
+
+ public GameWorld(int w, int h) {
+ WIDTH = w;
+ HEIGHT = h;
+ foreMap = new int[WIDTH][HEIGHT];
+ backMap = new int[WIDTH][HEIGHT];
+ }
+
+ public int getWidth() {
+ return WIDTH;
+ }
+
+ public int getHeight() {
+ return HEIGHT;
+ }
+
+ public int getForeMap(int x, int y) {
+ return foreMap[x][y];
+ }
+
+ public void setForeMap(int x, int y, int value) {
+ foreMap[x][y] = value;
+ }
+
+ public int getBackMap(int x, int y) {
+ return backMap[x][y];
+ }
+
+ public void setBackMap(int x, int y, int value) {
+ backMap[x][y] = value;
+ }
+
+}