diff --git a/android/assets/1280x720/bar.png b/android/assets/1280x720/bar.png index 468d986..606fd37 100755 Binary files a/android/assets/1280x720/bar.png and b/android/assets/1280x720/bar.png differ diff --git a/android/assets/1280x720/laser.png b/android/assets/1280x720/laser.png index 941efc7..e5aa06b 100755 Binary files a/android/assets/1280x720/laser.png and b/android/assets/1280x720/laser.png differ diff --git a/android/assets/1280x720/polyjet-standard.png b/android/assets/1280x720/polyjet-standard.png index ab9172c..286ad5d 100755 Binary files a/android/assets/1280x720/polyjet-standard.png and b/android/assets/1280x720/polyjet-standard.png differ diff --git a/android/assets/1280x800/bar.png b/android/assets/1280x800/bar.png index 1b51029..deb93bd 100755 Binary files a/android/assets/1280x800/bar.png and b/android/assets/1280x800/bar.png differ diff --git a/android/assets/1280x800/laser.png b/android/assets/1280x800/laser.png index f2bb4b0..5b82d55 100755 Binary files a/android/assets/1280x800/laser.png and b/android/assets/1280x800/laser.png differ diff --git a/android/assets/1280x800/polyjet-standard.png b/android/assets/1280x800/polyjet-standard.png index 00e941e..63fe63d 100755 Binary files a/android/assets/1280x800/polyjet-standard.png and b/android/assets/1280x800/polyjet-standard.png differ diff --git a/android/assets/1366x768/bar.png b/android/assets/1366x768/bar.png index d9a978a..951f25b 100755 Binary files a/android/assets/1366x768/bar.png and b/android/assets/1366x768/bar.png differ diff --git a/android/assets/1366x768/laser.png b/android/assets/1366x768/laser.png index 3486249..18034cc 100755 Binary files a/android/assets/1366x768/laser.png and b/android/assets/1366x768/laser.png differ diff --git a/android/assets/1366x768/polyjet-standard.png b/android/assets/1366x768/polyjet-standard.png index b3cf14c..9a5c154 100755 Binary files a/android/assets/1366x768/polyjet-standard.png and b/android/assets/1366x768/polyjet-standard.png differ diff --git a/android/assets/1920x1080/bar.png b/android/assets/1920x1080/bar.png index 4383352..d384455 100755 Binary files a/android/assets/1920x1080/bar.png and b/android/assets/1920x1080/bar.png differ diff --git a/android/assets/1920x1080/laser.png b/android/assets/1920x1080/laser.png index f60573b..c7e0405 100755 Binary files a/android/assets/1920x1080/laser.png and b/android/assets/1920x1080/laser.png differ diff --git a/android/assets/1920x1080/polyjet-standard.png b/android/assets/1920x1080/polyjet-standard.png index 27c88fa..cfec492 100755 Binary files a/android/assets/1920x1080/polyjet-standard.png and b/android/assets/1920x1080/polyjet-standard.png differ diff --git a/android/assets/1920x1200/bar.png b/android/assets/1920x1200/bar.png index 12c9400..738b095 100755 Binary files a/android/assets/1920x1200/bar.png and b/android/assets/1920x1200/bar.png differ diff --git a/android/assets/1920x1200/laser.png b/android/assets/1920x1200/laser.png index f6aadd3..1528938 100755 Binary files a/android/assets/1920x1200/laser.png and b/android/assets/1920x1200/laser.png differ diff --git a/android/assets/1920x1200/polyjet-standard.png b/android/assets/1920x1200/polyjet-standard.png index a89dc4d..c374e1a 100755 Binary files a/android/assets/1920x1200/polyjet-standard.png and b/android/assets/1920x1200/polyjet-standard.png differ diff --git a/android/assets/2560x1440/bar.png b/android/assets/2560x1440/bar.png index 19bff9e..c5b6b3a 100755 Binary files a/android/assets/2560x1440/bar.png and b/android/assets/2560x1440/bar.png differ diff --git a/android/assets/2560x1440/laser.png b/android/assets/2560x1440/laser.png index 8cf7348..6ea99f4 100755 Binary files a/android/assets/2560x1440/laser.png and b/android/assets/2560x1440/laser.png differ diff --git a/android/assets/2560x1440/polyjet-standard.png b/android/assets/2560x1440/polyjet-standard.png index 7fab794..c2b6f32 100755 Binary files a/android/assets/2560x1440/polyjet-standard.png and b/android/assets/2560x1440/polyjet-standard.png differ diff --git a/android/assets/3840x2160/bar.png b/android/assets/3840x2160/bar.png index 0aef058..aaf5f9c 100755 Binary files a/android/assets/3840x2160/bar.png and b/android/assets/3840x2160/bar.png differ diff --git a/android/assets/3840x2160/laser.png b/android/assets/3840x2160/laser.png index 7fe9ac2..a37bde1 100755 Binary files a/android/assets/3840x2160/laser.png and b/android/assets/3840x2160/laser.png differ diff --git a/android/assets/3840x2160/polyjet-standard.png b/android/assets/3840x2160/polyjet-standard.png index a3d5d93..893c4fb 100755 Binary files a/android/assets/3840x2160/polyjet-standard.png and b/android/assets/3840x2160/polyjet-standard.png differ diff --git a/android/assets/800x480/bar.png b/android/assets/800x480/bar.png index 7bd6da2..28069cf 100755 Binary files a/android/assets/800x480/bar.png and b/android/assets/800x480/bar.png differ diff --git a/android/assets/800x480/laser.png b/android/assets/800x480/laser.png index 31eb6c9..9396d05 100755 Binary files a/android/assets/800x480/laser.png and b/android/assets/800x480/laser.png differ diff --git a/android/assets/800x480/polyjet-standard.png b/android/assets/800x480/polyjet-standard.png index fcf0c1a..5e7af87 100755 Binary files a/android/assets/800x480/polyjet-standard.png and b/android/assets/800x480/polyjet-standard.png differ diff --git a/android/assets/sounds/explosion.ogg b/android/assets/sounds/explosion.ogg new file mode 100755 index 0000000..e4ce237 Binary files /dev/null and b/android/assets/sounds/explosion.ogg differ diff --git a/android/assets/sounds/laser.ogg b/android/assets/sounds/laser.ogg new file mode 100755 index 0000000..e3ea3f5 Binary files /dev/null and b/android/assets/sounds/laser.ogg differ diff --git a/core/src/zero1hd/polyjet/Polyjet.java b/core/src/zero1hd/polyjet/Polyjet.java index e0ff06c..49a93d9 100755 --- a/core/src/zero1hd/polyjet/Polyjet.java +++ b/core/src/zero1hd/polyjet/Polyjet.java @@ -130,6 +130,8 @@ public class Polyjet extends Game { assetManager.load("flake.png", Texture.class); assetManager.load("star_bg.png", Texture.class); assetManager.load("void_circle.png", Texture.class); + assetManager.load("laser.ogg", Sound.class); + assetManager.load("explosion.ogg", Sound.class); } public void generateFonts() { initComplete = true; diff --git a/core/src/zero1hd/polyjet/entity/EntityController.java b/core/src/zero1hd/polyjet/entity/EntityController.java index a1babbb..362ab83 100755 --- a/core/src/zero1hd/polyjet/entity/EntityController.java +++ b/core/src/zero1hd/polyjet/entity/EntityController.java @@ -3,7 +3,9 @@ package zero1hd.polyjet.entity; import java.util.Arrays; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Preferences; import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.utils.Array; @@ -19,6 +21,7 @@ import zero1hd.polyjet.entity.enemies.VoidCircle; public class EntityController { AssetManager assets; + Preferences prefs; public Array activeAllies; public Array activeEnemies; @@ -33,10 +36,11 @@ public class EntityController { //Ally pool declaration; private Pool laserPool; - public EntityController(AssetManager assetManager) { + public EntityController(AssetManager assetManager, Preferences preferences) { activeAllies = new Array(); activeEnemies = new Array(); this.assets = assetManager; + this.prefs = preferences; //Enemy pool initialization; voidCirclePool = new Pool() { @@ -45,24 +49,28 @@ public class EntityController { return new VoidCircle(assets.get("void_circle.png", Texture.class)); } }; + pelletPool = new Pool() { @Override protected Pellet newObject() { return new Pellet(assets.get("pellet.png", Texture.class)); } }; + shardPool = new Pool() { @Override protected Shard newObject() { return new Shard(assets.get("shard.png", Texture.class)); } }; + barPool = new Pool() { @Override protected Bar newObject() { return new Bar(assets.get("bar.png", Texture.class)); } }; + flakePool = new Pool() { @Override protected Flake newObject() { @@ -74,10 +82,9 @@ public class EntityController { laserPool = new Pool() { @Override protected Laser newObject() { - return new Laser(assets.get("laser.png", Texture.class)); + return new Laser(assets.get("laser.png", Texture.class), assets.get("laser.ogg", Sound.class), prefs); } }; - } public Entity retrieveEntity(Entities entity) { diff --git a/core/src/zero1hd/polyjet/entity/ally/Laser.java b/core/src/zero1hd/polyjet/entity/ally/Laser.java index 740170f..41dc0fa 100755 --- a/core/src/zero1hd/polyjet/entity/ally/Laser.java +++ b/core/src/zero1hd/polyjet/entity/ally/Laser.java @@ -1,5 +1,7 @@ package zero1hd.polyjet.entity.ally; +import com.badlogic.gdx.Preferences; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.math.Rectangle; @@ -15,9 +17,13 @@ public class Laser extends Actor implements Entity, Poolable { private float rate; boolean dead; Texture laserTexture; + Sound sfx; + Preferences prefs; - public Laser(Texture laserTexture) { + public Laser(Texture laserTexture, Sound sfx, Preferences prefs) { this.laserTexture = laserTexture; + this.sfx = sfx; + this.prefs = prefs; setSize(0.25f, 2f); } @@ -27,6 +33,7 @@ public class Laser extends Actor implements Entity, Poolable { this.rate = rate; hitBox = new Rectangle(); hitBox.setSize(getWidth(), getHeight()); + sfx.play(prefs.getFloat("fx vol")/100f); toBack(); } diff --git a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java index a0dd0f2..4afc6ad 100755 --- a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java @@ -126,17 +126,16 @@ public class MusicSelectionPage extends Page { int prog = (int) (100f*music/(musicFiles.length-1f)); loadingWindow.setProgress(prog); } - loadingWindow.remove(); - } else { - NoticeWindow notice = new NoticeWindow(core.getDefaultSkin(), "default", "No song's found in:\n\"" + core.getPrefs().getString("music dir") + "\"\nTo change the search directory, go to game options."); + NoticeWindow notice = new NoticeWindow(core.getDefaultSkin(), "default", "No song's found in:\n\"" + core.getPrefs().getString("music dir") + "\"\nTo change the search directory, go to game options.", core.getPrefs().getLong("fx vol"), core.getAssetManager()); notice.setSize(0.6f*getWidth(), 0.6f*getHeight()); notice.setPosition((getWidth()-notice.getWidth())/2f, (getHeight()-notice.getHeight())/2f); notice.setModal(true); notice.setMovable(false); loadingWindow.remove(); addActor(notice); + notice.playOpenSound(); } } }).start(); diff --git a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java index b1cdc69..c98e265 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java @@ -3,12 +3,9 @@ package zero1hd.polyjet.ui.stages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.assets.AssetManager; -import com.badlogic.gdx.graphics.Camera; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.graphics.glutils.ShaderProgram; @@ -39,10 +36,11 @@ public class GamePlayArea extends Stage { private int score; private ShaderProgram glowShader; - private ShaderProgram bgShader; private FrameBuffer blurTarget; TextureRegion fboRegion; private int fboSize; + + private ShaderProgram bgShader; private Texture background; private float time; @@ -53,7 +51,7 @@ public class GamePlayArea extends Stage { background = assetManager.get("star_bg.png"); polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard"); - ec = new EntityController(assetManager); + ec = new EntityController(assetManager, prefs); collisionDetector = new CollisionDetector(ec.activeAllies, ec.activeEnemies); ec.activeAllies.add(polyjet); addActor(polyjet); @@ -123,6 +121,8 @@ public class GamePlayArea extends Stage { getBatch().draw(background, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT); getBatch().end(); + getBatch().setShader(null); + if (glowShader != null) { blurTarget.begin(); @@ -130,7 +130,6 @@ public class GamePlayArea extends Stage { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); getBatch().setBlendFunction(-1, -1); Gdx.gl20.glBlendFuncSeparate(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA,GL20.GL_ONE, GL20.GL_DST_ALPHA); - getBatch().setShader(null); super.draw(); blurTarget.end(getViewport().getScreenX(), getViewport().getScreenY(), getViewport().getScreenWidth(), getViewport().getScreenHeight()); getBatch().setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); @@ -144,7 +143,6 @@ public class GamePlayArea extends Stage { getBatch().end(); } else { - getBatch().setShader(null); super.draw(); } } @@ -265,6 +263,13 @@ public class GamePlayArea extends Stage { @Override public void dispose() { + if (glowShader != null) { + blurTarget.dispose(); + glowShader.dispose(); + } + if (bgShader != null) { + bgShader.dispose(); + } super.dispose(); } diff --git a/core/src/zero1hd/polyjet/ui/windows/LoadingWindow.java b/core/src/zero1hd/polyjet/ui/windows/LoadingWindow.java index 1696bc1..cc9b895 100755 --- a/core/src/zero1hd/polyjet/ui/windows/LoadingWindow.java +++ b/core/src/zero1hd/polyjet/ui/windows/LoadingWindow.java @@ -73,6 +73,7 @@ public class LoadingWindow extends Window implements Disposable { closeSound.play(vol/100f); return super.remove(); } + public void setProgress(float progress) { status.setText(String.valueOf((int) progress) + '%'); } diff --git a/core/src/zero1hd/polyjet/ui/windows/NoticeWindow.java b/core/src/zero1hd/polyjet/ui/windows/NoticeWindow.java index 90fb4c8..54e55d5 100755 --- a/core/src/zero1hd/polyjet/ui/windows/NoticeWindow.java +++ b/core/src/zero1hd/polyjet/ui/windows/NoticeWindow.java @@ -1,5 +1,7 @@ package zero1hd.polyjet.ui.windows; +import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; @@ -10,20 +12,32 @@ import com.badlogic.gdx.utils.Align; public class NoticeWindow extends Window { private Label noticeText; private Skin skin; - public NoticeWindow(Skin skin, String styleName, String text) { + + private Sound closeSound; + private Sound openSound; + private float vol; + public NoticeWindow(Skin skin, String styleName, String text, float vol, AssetManager assets) { super("Notice", skin, "tinted"); this.skin = skin; + this.openSound = assets.get("pop_open.ogg", Sound.class); + this.closeSound = assets.get("pop_close.ogg", Sound.class); + this.vol = vol; + noticeText = new Label(text, skin, "sub-font", skin.getColor("default")); noticeText.setWrap(true); noticeText.setAlignment(Align.center); add(noticeText).expandX().fill().center().padLeft(20f).padRight(20f); } - public NoticeWindow(Skin skin, String styleName, String title, String text) { + public NoticeWindow(Skin skin, String styleName, String title, String text, float vol, AssetManager assets) { super(title, skin, styleName); this.skin = skin; + this.openSound = assets.get("pop_open.ogg", Sound.class); + this.closeSound = assets.get("pop_close.ogg", Sound.class); + this.vol = vol; + noticeText = new Label(text, skin, "sub-font", skin.getColor("default")); noticeText.setWrap(true); noticeText.setAlignment(Align.center); @@ -36,4 +50,14 @@ public class NoticeWindow extends Window { add(button).align(alignment); } + public void playOpenSound() { + openSound.play(vol/100f); + } + + @Override + public boolean remove() { + closeSound.play(vol/100f); + return super.remove(); + } + }