diff --git a/android/assets/1280x720/star_bg.png b/android/assets/1280x720/star_bg.png index 943a44d..81bcfb1 100755 Binary files a/android/assets/1280x720/star_bg.png and b/android/assets/1280x720/star_bg.png differ diff --git a/android/assets/1280x800/star_bg.png b/android/assets/1280x800/star_bg.png index 6d11812..e6036b5 100755 Binary files a/android/assets/1280x800/star_bg.png and b/android/assets/1280x800/star_bg.png differ diff --git a/android/assets/1366x768/star_bg.png b/android/assets/1366x768/star_bg.png index ed60091..890b1b2 100755 Binary files a/android/assets/1366x768/star_bg.png and b/android/assets/1366x768/star_bg.png differ diff --git a/android/assets/1920x1080/star_bg.png b/android/assets/1920x1080/star_bg.png index ed267c8..c9f5785 100755 Binary files a/android/assets/1920x1080/star_bg.png and b/android/assets/1920x1080/star_bg.png differ diff --git a/android/assets/1920x1200/star_bg.png b/android/assets/1920x1200/star_bg.png index 82aee1b..08437b0 100755 Binary files a/android/assets/1920x1200/star_bg.png and b/android/assets/1920x1200/star_bg.png differ diff --git a/android/assets/2560x1440/star_bg.png b/android/assets/2560x1440/star_bg.png index f56a342..42d1c0d 100755 Binary files a/android/assets/2560x1440/star_bg.png and b/android/assets/2560x1440/star_bg.png differ diff --git a/android/assets/3840x2160/star_bg.png b/android/assets/3840x2160/star_bg.png index 5ad9954..5f82063 100755 Binary files a/android/assets/3840x2160/star_bg.png and b/android/assets/3840x2160/star_bg.png differ diff --git a/android/assets/800x480/star_bg.png b/android/assets/800x480/star_bg.png index feb856e..200cf4f 100755 Binary files a/android/assets/800x480/star_bg.png and b/android/assets/800x480/star_bg.png differ diff --git a/android/assets/uiskin.png b/android/assets/uiskin.png index b81dd73..3c5cc19 100755 Binary files a/android/assets/uiskin.png and b/android/assets/uiskin.png differ diff --git a/core/src/zero1hd/rhythmbullet/RhythmBullet.java b/core/src/zero1hd/rhythmbullet/RhythmBullet.java index 625dea6..b7d85e3 100755 --- a/core/src/zero1hd/rhythmbullet/RhythmBullet.java +++ b/core/src/zero1hd/rhythmbullet/RhythmBullet.java @@ -195,6 +195,9 @@ public class RhythmBullet extends Game { subTextbutton.font = getDefaultSkin().getFont("sub-font"); getDefaultSkin().add("sub", subTextbutton); + TextButtonStyle windowTextButton = new TextButtonStyle(defaultTextButton); + windowTextButton.font = getDefaultSkin().getFont("window-font"); + getDefaultSkin().add("window", windowTextButton); TextButtonStyle textButtonLeft = new TextButtonStyle(); textButtonLeft.up = getDefaultSkin().getDrawable("left-button"); diff --git a/core/src/zero1hd/rhythmbullet/entity/CollisionDetector.java b/core/src/zero1hd/rhythmbullet/entity/CollisionDetector.java index dfbbd23..1f70491 100755 --- a/core/src/zero1hd/rhythmbullet/entity/CollisionDetector.java +++ b/core/src/zero1hd/rhythmbullet/entity/CollisionDetector.java @@ -23,6 +23,7 @@ public class CollisionDetector { ParticleEffectPool explosionEffectPool; Array effects = new Array<>(); + private int amassedPoints; Sound explosionSFX; public CollisionDetector(Array enemies, Array allies, AssetManager assetManager, Preferences prefs) { this.enemies = enemies; @@ -58,6 +59,8 @@ public class CollisionDetector { enemy.collided(ally); ally.collided(enemy); + + amassedPoints += enemy.getPoints(); break; } } @@ -89,4 +92,10 @@ public class CollisionDetector { batch.end(); } } + + public int getAmassedPoints() { + int amassedPoints = this.amassedPoints; + this.amassedPoints = 0; + return amassedPoints; + } } diff --git a/core/src/zero1hd/rhythmbullet/entity/Entity.java b/core/src/zero1hd/rhythmbullet/entity/Entity.java index 3ab3387..af205dd 100755 --- a/core/src/zero1hd/rhythmbullet/entity/Entity.java +++ b/core/src/zero1hd/rhythmbullet/entity/Entity.java @@ -37,7 +37,7 @@ public class Entity extends Actor implements Poolable { public float angle; public float speed; - + protected int points; /** * called by the entity frame and only once (when this object is created). @@ -162,6 +162,7 @@ public class Entity extends Actor implements Poolable { center.set(0, 0); angle = 0; speed = 0; + points = 0; dead = false; } @@ -185,4 +186,8 @@ public class Entity extends Actor implements Poolable { this.coordinator = coordinator; coordinator.setEntity(this); } + + public int getPoints() { + return points + (coordinator != null ? coordinator.getScoreBonus() : 0); + } } diff --git a/core/src/zero1hd/rhythmbullet/entity/ally/PolyJetEntity.java b/core/src/zero1hd/rhythmbullet/entity/ally/PolyJetEntity.java index c04306e..a6adae4 100755 --- a/core/src/zero1hd/rhythmbullet/entity/ally/PolyJetEntity.java +++ b/core/src/zero1hd/rhythmbullet/entity/ally/PolyJetEntity.java @@ -9,21 +9,23 @@ import com.badlogic.gdx.scenes.scene2d.actions.Actions; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.entity.Entity; +import zero1hd.rhythmbullet.ui.builders.HealthBar; public class PolyJetEntity extends Entity { public float health; private ParticleEffect thrust; private Texture polyjet; private ParticleEffect teleportCloak; - + private HealthBar hpBar; public boolean moveLeft, moveRight, moveUp, moveDown, teleporting, accelerate; private float speed, accel; private float rate; - public PolyJetEntity(AssetManager assets, float speed, float accel, String jet) { + public PolyJetEntity(AssetManager assets, float speed, float accel, String jet, HealthBar hpBar) { nonStnrd = true; health = 100; this.speed = speed; this.accel = accel; + this.hpBar = hpBar; setSize(1.5f, 1.5f); setPosition(RhythmBullet.GAME_AREA_WIDTH/2 - getWidth()/2, -4f); @@ -70,6 +72,8 @@ public class PolyJetEntity extends Entity { if (health <= 0) { dead = true; + } else if (health > hpBar.getMaxHealth()) { + health = hpBar.getMaxHealth(); } super.act(delta); @@ -89,4 +93,9 @@ public class PolyJetEntity extends Entity { public Rectangle getHitbox() { return hitbox; } + + public void setHealth(float health) { + hpBar.setHealth(health); + this.health = health; + } } diff --git a/core/src/zero1hd/rhythmbullet/entity/coordinator/Coordinator.java b/core/src/zero1hd/rhythmbullet/entity/coordinator/Coordinator.java index c74da92..f048447 100755 --- a/core/src/zero1hd/rhythmbullet/entity/coordinator/Coordinator.java +++ b/core/src/zero1hd/rhythmbullet/entity/coordinator/Coordinator.java @@ -9,6 +9,7 @@ public class Coordinator implements Poolable { private CoordinatorFrame cf; protected EntityManager em; protected Entity entity; + protected int scoreBonus; public void setup(EntityManager em, CoordinatorFrame cf) { this.em = em; @@ -34,4 +35,8 @@ public class Coordinator implements Poolable { public void reset() { entity = null; } + + public int getScoreBonus() { + return scoreBonus; + } } diff --git a/core/src/zero1hd/rhythmbullet/entity/enemies/Pellet.java b/core/src/zero1hd/rhythmbullet/entity/enemies/Pellet.java index 3fe4c1a..9bcc757 100755 --- a/core/src/zero1hd/rhythmbullet/entity/enemies/Pellet.java +++ b/core/src/zero1hd/rhythmbullet/entity/enemies/Pellet.java @@ -24,7 +24,6 @@ public class Pellet extends Entity implements Poolable { this.angle = angle; } - /** * Vars: x, y, speed, angle; */ diff --git a/core/src/zero1hd/rhythmbullet/screens/CreativeDebugScreen.java b/core/src/zero1hd/rhythmbullet/screens/CreativeScreen.java similarity index 71% rename from core/src/zero1hd/rhythmbullet/screens/CreativeDebugScreen.java rename to core/src/zero1hd/rhythmbullet/screens/CreativeScreen.java index e8d8a58..b0035b2 100755 --- a/core/src/zero1hd/rhythmbullet/screens/CreativeDebugScreen.java +++ b/core/src/zero1hd/rhythmbullet/screens/CreativeScreen.java @@ -10,10 +10,12 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.ui.stages.CreativeHUD; +import zero1hd.rhythmbullet.ui.stages.GameHUD; import zero1hd.rhythmbullet.ui.stages.GamePlayArea; -public class CreativeDebugScreen extends ScreenAdapter { - CreativeHUD creative; +public class CreativeScreen extends ScreenAdapter { + CreativeHUD chud; + GameHUD ghud; GamePlayArea gamePlayArea; InputMultiplexer inputs; @@ -22,12 +24,12 @@ public class CreativeDebugScreen extends ScreenAdapter { Preferences prefs; - public CreativeDebugScreen(RhythmBullet core, MainMenu mainMenu) { - gamePlayArea = new GamePlayArea(core.getAssetManager(), core.getPrefs()); - creative = new CreativeHUD(core, mainMenu, gamePlayArea); - - inputs = new InputMultiplexer(creative, gamePlayArea); - + public CreativeScreen(RhythmBullet core, MainMenu mainMenu) { + ghud = new GameHUD(core.getDefaultSkin(), 100f); + gamePlayArea = new GamePlayArea(core.getAssetManager(), core.getPrefs(), ghud); + chud = new CreativeHUD(core, mainMenu, gamePlayArea); + inputs = new InputMultiplexer(chud, gamePlayArea); + this.prefs = core.getPrefs(); background = core.getAssetManager().get("star_bg.png"); @@ -55,9 +57,13 @@ public class CreativeDebugScreen extends ScreenAdapter { gamePlayArea.act(); gamePlayArea.draw(); - creative.getViewport().apply(); - creative.act(); - creative.draw(); + ghud.getViewport().apply(); + ghud.act(); + ghud.draw(); + + chud.getViewport().apply(); + chud.act(); + chud.draw(); super.render(delta); } diff --git a/core/src/zero1hd/rhythmbullet/screens/GameScreen.java b/core/src/zero1hd/rhythmbullet/screens/GameScreen.java index 0faffa4..d41a8cf 100755 --- a/core/src/zero1hd/rhythmbullet/screens/GameScreen.java +++ b/core/src/zero1hd/rhythmbullet/screens/GameScreen.java @@ -46,8 +46,8 @@ public class GameScreen extends ScreenAdapter { } }); - gameArea = new GamePlayArea(core.getAssetManager(), core.getPrefs()); - gameHUD = new GameHUD(core.getDefaultSkin(), gameArea.getMaxHealth()); + gameHUD = new GameHUD(core.getDefaultSkin(), 100f); + gameArea = new GamePlayArea(core.getAssetManager(), core.getPrefs(), gameHUD); inputs = new InputMultiplexer(); inputs.addProcessor(gameHUD); @@ -113,7 +113,6 @@ public class GameScreen extends ScreenAdapter { //actual game and hud if (!gameHUD.isPaused()) { - gameHUD.setScore(gameArea.getScore()); gameArea.act(delta); if (gameArea.getPolyjet().isDead()) { end(false); diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java b/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java index ed9574f..76c96c8 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java +++ b/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java @@ -9,9 +9,9 @@ import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; public class HealthBar extends WidgetGroup { Image empty; Image filler; - int health; - int maxHealth; - public HealthBar(Skin skin, int maxHealth) { + float health; + float maxHealth; + public HealthBar(Skin skin, float maxHealth) { super(); filler = new Image(skin.getPatch("bar-fill")); addActor(filler); @@ -24,7 +24,7 @@ public class HealthBar extends WidgetGroup { } - public void setHealth(int health) { + public void setHealth(float health) { this.health = health; filler.addAction(Actions.sizeTo(getWidth(), MathUtils.round((health/maxHealth)*getHeight()), 0.1f));; @@ -49,4 +49,8 @@ public class HealthBar extends WidgetGroup { empty.setHeight(height); super.setHeight(height); } + + public float getMaxHealth() { + return maxHealth; + } } diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java b/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java index 027c2bc..6b8d2ea 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java @@ -17,7 +17,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextField; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import zero1hd.rhythmbullet.RhythmBullet; -import zero1hd.rhythmbullet.screens.CreativeDebugScreen; +import zero1hd.rhythmbullet.screens.CreativeScreen; import zero1hd.rhythmbullet.screens.MainMenu; public class OptionsPage extends Page { @@ -152,7 +152,7 @@ public class OptionsPage extends Page { if (core.getAssetManager().update() && goToScreen != 0) { switch (goToScreen) { case 1: - core.setScreen(new CreativeDebugScreen(core, (MainMenu) core.getScreen())); + core.setScreen(new CreativeScreen(core, (MainMenu) core.getScreen())); } goToScreen = 0; } diff --git a/core/src/zero1hd/rhythmbullet/ui/stages/CreativeHUD.java b/core/src/zero1hd/rhythmbullet/ui/stages/CreativeHUD.java index 2cd2826..fad6f17 100755 --- a/core/src/zero1hd/rhythmbullet/ui/stages/CreativeHUD.java +++ b/core/src/zero1hd/rhythmbullet/ui/stages/CreativeHUD.java @@ -59,8 +59,14 @@ public class CreativeHUD extends Stage implements MiniListener { spawnerWindow = new SpawnerWindow("Spawn Tool", core.getDefaultSkin(), gpa.em, gpa.cm, gpa); diffWindow = new DifficultyWindow(core.getDefaultSkin()); + toolbox = new Window("Tools", core.getDefaultSkin(), "tinted"); + toolbox.defaults().pad(5f); + + Table toolboxToolSet = new Table(core.getDefaultSkin()); + toolboxToolSet.defaults().space(5f).left(); + //Back button - TextButton backButton = new TextButton("Back", core.getDefaultSkin()); + TextButton backButton = new TextButton("Back", core.getDefaultSkin(), "window"); backButton.addListener(new ChangeListener() { @Override @@ -69,16 +75,9 @@ public class CreativeHUD extends Stage implements MiniListener { core.setScreen(mainMenu); } }); - backButton.setPosition(10, Gdx.graphics.getHeight()-backButton.getHeight()-10); - addActor(backButton); - - - toolbox = new Window("Tools", core.getDefaultSkin(), "tinted"); - toolbox.defaults().pad(5f); - - Table toolboxToolSet = new Table(core.getDefaultSkin()); - toolboxToolSet.defaults().space(5f); - + toolboxToolSet.add(backButton); + toolboxToolSet.row(); + final CheckBox musicSelectorCheckbox = new CheckBox(" Music selector", core.getDefaultSkin()); musicSelectorCheckbox.addListener(new ChangeListener() { @@ -200,8 +199,7 @@ public class CreativeHUD extends Stage implements MiniListener { toolboxToolSet.add(diffAdjusterCheckBox); ScrollPane scroller = new ScrollPane(toolboxToolSet, core.getDefaultSkin()); - toolbox.add(scroller).expand().fill(); - toolbox.setSize(300, 300); + toolbox.add(scroller).height(250f).width(150f); addActor(toolbox); addListener(new InputListener() { @@ -213,7 +211,6 @@ public class CreativeHUD extends Stage implements MiniListener { return super.keyUp(event, keycode); } }); - toolboxToolSet.pack(); toolbox.pack(); } diff --git a/core/src/zero1hd/rhythmbullet/ui/stages/GameHUD.java b/core/src/zero1hd/rhythmbullet/ui/stages/GameHUD.java index 70c1db5..9279343 100755 --- a/core/src/zero1hd/rhythmbullet/ui/stages/GameHUD.java +++ b/core/src/zero1hd/rhythmbullet/ui/stages/GameHUD.java @@ -16,7 +16,7 @@ import zero1hd.rhythmbullet.ui.windows.FPSWindow; import zero1hd.rhythmbullet.ui.windows.PauseMenu; public class GameHUD extends Stage { - private Label score; + private Label scoreLabel; private ImageButton pause; private boolean paused; private FPSWindow fpsWindow; @@ -25,11 +25,11 @@ public class GameHUD extends Stage { private Music music; - public GameHUD(Skin skin, int maxHealth) { + public GameHUD(Skin skin, float maxHealth) { super(); - score = new Label("Score: 0", skin, "default-font", Color.WHITE); - score.setPosition(10f, Gdx.graphics.getHeight()-score.getHeight() - 10f); - addActor(score); + scoreLabel = new Label("Score: 0", skin, "default-font", Color.WHITE); + scoreLabel.setPosition(10f, Gdx.graphics.getHeight()-scoreLabel.getHeight() - 10f); + addActor(scoreLabel); pause = new ImageButton(skin.getDrawable("pause"), skin.getDrawable("pause-down")); @@ -67,15 +67,7 @@ public class GameHUD extends Stage { * @param score designated score */ public void setScore(int score) { - this.score.setText("Score: " + score); - } - - /** - * returns current score by use of substring - * @return the current score value - */ - public int getScore() { - return Integer.valueOf(score.getText().substring(7)); + this.scoreLabel.setText("Score: " + score); } public void setPaused(boolean paused) { @@ -128,4 +120,8 @@ public class GameHUD extends Stage { public void setMusic(Music music) { this.music = music; } + + public HealthBar getHealthBar() { + return healthBar; + } } diff --git a/core/src/zero1hd/rhythmbullet/ui/stages/GamePlayArea.java b/core/src/zero1hd/rhythmbullet/ui/stages/GamePlayArea.java index 1a9a39f..b0c3994 100755 --- a/core/src/zero1hd/rhythmbullet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/rhythmbullet/ui/stages/GamePlayArea.java @@ -28,12 +28,12 @@ public class GamePlayArea extends Stage { public PolyJetEntity polyjet; private GamePlayMap audioMap; + private GameHUD gameHUD; + public CoordinatorManager cm; public EntityManager em; private CollisionDetector collisionDetector; - private int maxHealth = 100; - private float yTeleport = RhythmBullet.GAME_AREA_HEIGHT/2; private int score; @@ -43,13 +43,15 @@ public class GamePlayArea extends Stage { TextureRegion fboRegion; private int fboSize; - public GamePlayArea(AssetManager assetManager, Preferences prefs) { + public GamePlayArea(AssetManager assetManager, Preferences prefs, GameHUD gameHUD) { super(new FitViewport(RhythmBullet.GAME_AREA_WIDTH, RhythmBullet.GAME_AREA_HEIGHT)); Gdx.app.debug("Game Area", "new area created"); - polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard"); + polyjet = new PolyJetEntity(assetManager, 25f, 25f, "standard", gameHUD.getHealthBar()); em = new EntityManager(assetManager, prefs, this); cm = new CoordinatorManager(em); + this.gameHUD = gameHUD; + collisionDetector = new CollisionDetector(em.activeEnemies, em.activeAllies, assetManager, prefs); em.activeAllies.add(polyjet); addActor(polyjet); @@ -141,6 +143,7 @@ public class GamePlayArea extends Stage { } collisionDetector.collisionCheck(); + addScore(collisionDetector.getAmassedPoints()); if (polyjet.getX() <= 1) { polyjet.moveLeft = false; @@ -165,11 +168,7 @@ public class GamePlayArea extends Stage { } public void addScore (int score) { - this.score += score; - polyjet.health += score; - if (polyjet.health > maxHealth) { - polyjet.health = maxHealth; - } + setScore(this.score += score); } @Override @@ -226,13 +225,11 @@ public class GamePlayArea extends Stage { return polyjet; } - public int getScore() { - return score; + public void setScore(int score) { + this.score = score; + gameHUD.setScore(score); } - public int getMaxHealth() { - return maxHealth; - } public float getyTeleport() { return yTeleport; }