added new textures and made progress on shaders

This commit is contained in:
Harrison Deng 2017-06-11 18:28:12 -05:00
parent f353337395
commit 7a0a7c9b14
17 changed files with 14 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -3,10 +3,8 @@ package zero1hd.polyjet.ui.stages;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences; import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.FitViewport;
@ -37,10 +35,15 @@ public class GamePlayArea extends Stage {
private Vector2 resolution; private Vector2 resolution;
private float timePassed; private float timePassed;
private Texture background;
public GamePlayArea(AssetManager assetManager, Preferences prefs) { public GamePlayArea(AssetManager assetManager, Preferences prefs) {
super(new FitViewport(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT)); super(new FitViewport(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT));
Gdx.app.debug("Game Area", "new area created"); Gdx.app.debug("Game Area", "new area created");
background = assetManager.get("star_bg.png");
polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard"); polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard");
ec = new EntityController(assetManager); ec = new EntityController(assetManager);
collisionDetector = new CollisionDetector(ec.activeAllies, ec.activeEnemies); collisionDetector = new CollisionDetector(ec.activeAllies, ec.activeEnemies);
@ -91,6 +94,14 @@ public class GamePlayArea extends Stage {
@Override @Override
public void draw() { public void draw() {
//TODO batch draw background //TODO batch draw background
if (bgShader != null) {
getBatch().setShader(bgShader);
}
getBatch().begin();
getBatch().draw(background, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
getBatch().end();
getBatch().setShader(null);
super.draw(); super.draw();
} }