diff --git a/core/src/com/me/brickbuster/BrickBuster.java b/core/src/com/me/brickbuster/BrickBuster.java index a0888c4..f5639fb 100644 --- a/core/src/com/me/brickbuster/BrickBuster.java +++ b/core/src/com/me/brickbuster/BrickBuster.java @@ -2,32 +2,38 @@ package com.me.brickbuster; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; public class BrickBuster extends ApplicationAdapter { - SpriteBatch batch; - Texture img; + + public static final int WIDTH = 800; + public static final int HEIGHT = 600; + public static final String TITLE = "Brick Buster"; + + ShapeRenderer shapeRenderer; @Override public void create () { - batch = new SpriteBatch(); - img = new Texture("badlogic.jpg"); + this.shapeRenderer = new ShapeRenderer(); + } @Override public void render () { - Gdx.gl.glClearColor(1, 0, 0, 1); + Gdx.gl.glClearColor(0.5f,1,1,1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - batch.begin(); - batch.draw(img, 0, 0); - batch.end(); + this.shapeRenderer.begin(ShapeType.Filled); + this.shapeRenderer.setColor(Color.CHARTREUSE); + this.shapeRenderer.circle(0,0, 100, 50); + this.shapeRenderer.end(); + } @Override public void dispose () { - batch.dispose(); - img.dispose(); + } } diff --git a/desktop/src/com/me/brickbuster/desktop/DesktopLauncher.java b/desktop/src/com/me/brickbuster/desktop/DesktopLauncher.java index e0f54fa..0afce69 100644 --- a/desktop/src/com/me/brickbuster/desktop/DesktopLauncher.java +++ b/desktop/src/com/me/brickbuster/desktop/DesktopLauncher.java @@ -7,6 +7,9 @@ import com.me.brickbuster.BrickBuster; public class DesktopLauncher { public static void main (String[] arg) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); + config.width = BrickBuster.WIDTH; + config.height = BrickBuster.HEIGHT; + config.title = BrickBuster.TITLE; new LwjglApplication(new BrickBuster(), config); } }