From 00786164d9332731647968f505be57fd2587b9cd Mon Sep 17 00:00:00 2001 From: MrGussio Date: Sat, 17 Jun 2017 12:35:53 +0200 Subject: [PATCH] Prepared everything for the beta release. Increased meteorite damage. Fixed "Retry" bug. --- core/src/ga/gussio/ld38/earthinvaders/Game.java | 4 ++-- .../ga/gussio/ld38/earthinvaders/entities/Meteorite.java | 2 +- .../ga/gussio/ld38/earthinvaders/screen/GameScreen.java | 7 +++++-- .../ga/gussio/ld38/earthinvaders/screen/MenuScreen.java | 6 ++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/src/ga/gussio/ld38/earthinvaders/Game.java b/core/src/ga/gussio/ld38/earthinvaders/Game.java index 246530c..c53ad11 100644 --- a/core/src/ga/gussio/ld38/earthinvaders/Game.java +++ b/core/src/ga/gussio/ld38/earthinvaders/Game.java @@ -101,8 +101,8 @@ public boolean scrolled(int amount) { } public static void setCurrentScreen(Screen s){ -// if(currentScreen != null) -//// currentScreen.dispose(); + if(currentScreen != null) + currentScreen.dispose(); if(listeners.contains(currentScreen)) listeners.remove(currentScreen); currentScreen = s; diff --git a/core/src/ga/gussio/ld38/earthinvaders/entities/Meteorite.java b/core/src/ga/gussio/ld38/earthinvaders/entities/Meteorite.java index 089fe94..cab42b7 100644 --- a/core/src/ga/gussio/ld38/earthinvaders/entities/Meteorite.java +++ b/core/src/ga/gussio/ld38/earthinvaders/entities/Meteorite.java @@ -92,7 +92,7 @@ public void tick() { collision.setX(x); collision.setY(y); if(collision.hasCollision(GameScreen.earth)){ - GameScreen.damageEarth((int)health*3); + GameScreen.damageEarth((int)health*5); // Game.playSound("METEOR1.wav", false, -20); destroy(); } diff --git a/core/src/ga/gussio/ld38/earthinvaders/screen/GameScreen.java b/core/src/ga/gussio/ld38/earthinvaders/screen/GameScreen.java index 1239e6f..c40273b 100644 --- a/core/src/ga/gussio/ld38/earthinvaders/screen/GameScreen.java +++ b/core/src/ga/gussio/ld38/earthinvaders/screen/GameScreen.java @@ -54,6 +54,7 @@ public class GameScreen extends Screen implements InputListener { private int scoreTimer = 0; public GameScreen() { + entities.clear(); camera = new OrthographicCamera(); viewport = new FitViewport(Game.WIDTH, Game.HEIGHT, camera); viewport.apply(); @@ -93,7 +94,6 @@ public GameScreen() { int y = r.nextInt(Game.HEIGHT); background[i] = new Particle(x, y, 0, 0, -1, new Color(207/255f, 187/255f, 20/255f, 1f), size); } - score = 0; // resetting static value } @Override @@ -210,7 +210,10 @@ public void dispose() { for(int i = 0; i < meteoriteSprites.length; i++){ meteoriteSprites[i].getTexture().dispose(); } - System.out.print("dispose"); + + health = maxHealth; + score = 0; + dmgAnimation = 0; } public static void damageEarth(int hits){ diff --git a/core/src/ga/gussio/ld38/earthinvaders/screen/MenuScreen.java b/core/src/ga/gussio/ld38/earthinvaders/screen/MenuScreen.java index cdf0985..8012471 100644 --- a/core/src/ga/gussio/ld38/earthinvaders/screen/MenuScreen.java +++ b/core/src/ga/gussio/ld38/earthinvaders/screen/MenuScreen.java @@ -25,14 +25,15 @@ public class MenuScreen extends Screen implements InputListener { private Particle[] background; private Sprite logo; private Button play; - + private BitmapFont betaText; public MenuScreen(){ camera = new OrthographicCamera(); viewport = new FitViewport(Game.WIDTH, Game.HEIGHT, camera); viewport.apply(); camera.position.set(Game.WIDTH/2, Game.HEIGHT/2, 0); camera.update(); - + betaText = new BitmapFont(Gdx.files.internal("score.fnt"), Gdx.files.internal("score.png"), false); + betaText.getData().setScale(0.35f); logo = new Sprite(new Texture("logo.png")); Random r = new Random(); background = new Particle[r.nextInt(55-45)+45]; @@ -65,6 +66,7 @@ public void render(SpriteBatch sb, ShapeRenderer sr) { sb.begin(); sb.draw(logo, Game.WIDTH/2-(logo.getTexture().getWidth()*10)/2, Game.HEIGHT-50-logo.getHeight()*10, logo.getWidth()*10, logo.getHeight()*10); play.renderSB(sb); + betaText.draw(sb, "Beta Release - Copyright 2017 Gussio. All rights reserved. Visit https://gussio.ga/ for more info.", 10, 25); sb.end(); }