background changed, pellet resized, other minor cleanups and adjustments
This commit is contained in:
@@ -29,7 +29,7 @@ public class Pellet extends Actor implements Entity, Poolable {
|
||||
public void init(float x, float y, float angle, float rate) {
|
||||
setPosition(x, y);
|
||||
direction.set(MathUtils.sinDeg(angle), MathUtils.cosDeg(angle));
|
||||
setSize(0.75f, 0.75f);
|
||||
setSize(0.5f, 0.5f);
|
||||
hitBox.setSize(getWidth(), getHeight());
|
||||
this.rate = rate;
|
||||
}
|
||||
|
@@ -32,12 +32,9 @@ public class GamePlayArea extends Stage {
|
||||
private int score;
|
||||
|
||||
private ShaderProgram invert;
|
||||
private ShaderProgram bgShader;
|
||||
|
||||
private Texture background;
|
||||
|
||||
private float time;
|
||||
|
||||
public GamePlayArea(AssetManager assetManager, Preferences prefs) {
|
||||
super(new FitViewport(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT));
|
||||
Gdx.app.debug("Game Area", "new area created");
|
||||
@@ -51,7 +48,6 @@ public class GamePlayArea extends Stage {
|
||||
}
|
||||
|
||||
public void setAudioMap(GamePlayMap audioMap) {
|
||||
time = 0;
|
||||
this.audioMap = audioMap;
|
||||
}
|
||||
|
||||
@@ -75,23 +71,6 @@ public class GamePlayArea extends Stage {
|
||||
|
||||
}
|
||||
|
||||
if (prefs.getBoolean("bg shader")) {
|
||||
Gdx.app.debug("Shader", "using background shader");
|
||||
|
||||
bgShader = new ShaderProgram(Gdx.files.internal("shaders/star_vert.glsl").readString(), Gdx.files.internal("shaders/star_frag.glsl").readString());
|
||||
|
||||
if (!bgShader.isCompiled()) {
|
||||
System.err.println(bgShader.getLog());
|
||||
System.exit(0);
|
||||
}
|
||||
if (bgShader.getLog().length()!=0) {
|
||||
System.out.println(bgShader.getLog());
|
||||
}
|
||||
|
||||
} else {
|
||||
//TODO prepare background rendering without shader
|
||||
}
|
||||
|
||||
ShaderProgram.pedantic = false;
|
||||
}
|
||||
|
||||
@@ -99,18 +78,8 @@ public class GamePlayArea extends Stage {
|
||||
public void draw() {
|
||||
//TODO batch draw background
|
||||
getBatch().begin();
|
||||
|
||||
if (bgShader != null) {
|
||||
getBatch().setShader(bgShader);
|
||||
bgShader.setUniformf("resolution", background.getWidth(), background.getHeight());
|
||||
bgShader.setUniformf("time", time);
|
||||
}
|
||||
getBatch().draw(background, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT);
|
||||
getBatch().end();
|
||||
|
||||
|
||||
|
||||
getBatch().setShader(null);
|
||||
super.draw();
|
||||
}
|
||||
|
||||
@@ -119,7 +88,6 @@ public class GamePlayArea extends Stage {
|
||||
MapWindowData mwd;
|
||||
if (audioMap != null && audioMap.getPlayableClip().isPlaying()) {
|
||||
audioMap.getMusicData().readIndexUpdate();
|
||||
time = audioMap.getPlayableClip().getPosition();
|
||||
if ((mwd = audioMap.nextWindowData()) != null) {
|
||||
EntitySpawnInfo[] currentSpawnInfo = mwd.getArray();
|
||||
if (currentSpawnInfo != null) {
|
||||
|
Reference in New Issue
Block a user