Skip to content

Commit

Permalink
Release v1.0.1
Browse files Browse the repository at this point in the history
+ Fixed endless high scores
+ Updated readme with screenshots
+ Reduced phase 2 boss difficulty
  • Loading branch information
thebitspud committed May 7, 2022
1 parent db73d59 commit f9e13a2
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 20 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# <img align="left" src="./android/res/mipmap-mdpi/ic_launcher.png" alt="app icon">Astro Envoys
This is an Android space shooter I created in 2020 using LibGDX and Android Studio.
This is a mobile space shooter I created in 2020 using LibGDX and Android Studio.

## Installation
1. Download [astro-envoys.apk](./astro-envoys.apk) to your Android device
1. Download [astro-envoys-1.0.1.apk](./astro-envoys-1.0.1.apk) to your Android device
2. Locate the .apk file in your downloads or file system
3. Open the .apk file and install the application from (don't worry, it's safe)
4. Play the game!
Expand All @@ -16,7 +16,9 @@ I do not plan on uploading this game to Google Play so it must be manually insta
- A sense of pride and accomplishment

## Screenshots
WIP
| ![1](screenshots/1.jpg) | ![2](screenshots/2.jpg) | ![3](screenshots/3.jpg) |
|-------------------------|-------------------------|-------------------------|
| ![4](screenshots/4.jpg) | ![5](screenshots/5.jpg) | ![6](screenshots/6.jpg) |

## Assets Used
Player ship from [Starfighter Pack 01 by Wobblegut Studios](https://wobblegut-studios.itch.io/sf01) \
Expand Down
Binary file renamed astro-envoys.apk → astro-envoys-1.0.1.apk
Binary file not shown.
19 changes: 12 additions & 7 deletions core/src/io/thebitspud/astroenvoys/CampaignGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.thebitspud.astroenvoys.entities.projectiles.Projectile;
import io.thebitspud.astroenvoys.levels.Level;
import io.thebitspud.astroenvoys.levels.Level_Endless;
import io.thebitspud.astroenvoys.screens.LossScreen;

public class CampaignGame {
private final AstroEnvoys app;
Expand Down Expand Up @@ -75,8 +76,7 @@ public void spawnEnemy(int x, int y, EntityID id) {
}
}

// No enemies on screen (excludes asteroids)

// Returns true if there are no enemies on screen (excludes asteroids)
public boolean allEnemiesCleared() {
for(Enemy e : enemies) {
if (e.getID() != EntityID.ASTEROID) return false;
Expand All @@ -86,14 +86,19 @@ public boolean allEnemiesCleared() {
}

public void endGame(boolean victory) {
if(level instanceof Level_Endless) {
((Level_Endless) level).setHighScore();
}

if(victory) {
app.levelSelectScreen.getSelectedLevel().clearLevel();
app.setScreen(app.winScreen);
} else app.setScreen(app.lossScreen);
} else {
app.setScreen(app.lossScreen);

if(level instanceof Level_Endless) {
((Level_Endless) level).setHighScore();
((LossScreen) app.lossScreen).setTitleLabel("Score:\n" + ((Level_Endless) level).getLastScore());
} else {
((LossScreen) app.lossScreen).setTitleLabel("Level\nFailed");
}
}
}

public void addProjectile(int x, int y, float xVel, float yVel, EntityID id) {
Expand Down
10 changes: 4 additions & 6 deletions core/src/io/thebitspud/astroenvoys/entities/enemies/Reaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Reaper(int x, int y, AstroEnvoys app) {
cYOffset = -75;
setOrigin(getWidth() / 2, (getHeight() / 2 + cYOffset));
rotYPos = (int) (getY() + getOriginY());
yLimit = Gdx.graphics.getHeight() * 0.7f;
yLimit = Gdx.graphics.getHeight() * 0.75f;

secondStageActive = false;
nextSpawnHP = health;
Expand Down Expand Up @@ -94,18 +94,16 @@ public void adjustHealth(int value) {
health += value;

if(!secondStageActive && health <= 400) {
yLimit = Gdx.graphics.getHeight() * 0.5f;
yLimit = Gdx.graphics.getHeight() * 0.6f;
mainAttackTimer.setTimerDuration(0.2);
burstAttackTimer.setTimerDuration(0.8);
burstAttackTimer.setTimerDuration(1.0);
secondStageActive = true;
yVel = -80;
}

if(health <= nextSpawnHP) {
summonTimer.setTimeElapsed(10 + summonTimer.getTimeElapsed());

if(secondStageActive) nextSpawnHP -= 55;
else nextSpawnHP -= 80;
nextSpawnHP -= 80;
}

if (health > maxHealth) health = maxHealth;
Expand Down
20 changes: 17 additions & 3 deletions core/src/io/thebitspud/astroenvoys/levels/Level_Endless.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public Level_Endless(AstroEnvoys app) {
super(app);
}

long highScore = 0;
private long highScore = 0;
private long currentScore;

@Override
public String id() {
Expand All @@ -31,11 +32,12 @@ public String desc() {

@Override
protected void onClear() {

// Level cannot be cleared.
}

@Override
protected void addEvents() {
currentScore = 0;
final int y = Gdx.graphics.getHeight();
final int scrWidth = Gdx.graphics.getWidth(); // screen width

Expand All @@ -44,6 +46,7 @@ protected void addEvents() {
timers.add(new JTimerUtil(3, true, true) {
@Override
public void onActivation() {
currentScore += 1;
game.spawnEnemy(r.nextInt(scrWidth - 100), y, EntityID.ASTEROID);
if(getTimerDuration() > 1.0) setTimerDuration(getTimerDuration() * 0.99);
}
Expand All @@ -52,6 +55,7 @@ public void onActivation() {
timers.add(new JTimerUtil(2, true, true) {
@Override
public void onActivation() {
currentScore += 10;
game.spawnEnemy(r.nextInt(scrWidth - 120), y, EntityID.AZ_RAIDER);

if(getTimerDuration() == 2) setTimerDuration(6);
Expand All @@ -62,6 +66,7 @@ public void onActivation() {
timers.add(new JTimerUtil(20, true, true) {
@Override
public void onActivation() {
currentScore += 30;
int x = r.nextInt(scrWidth * 3/5) + scrWidth / 5 - 75;
game.spawnEnemy(x, y, EntityID.AZ_HUNTER);
if(getTimerDuration() > 6.0) setTimerDuration(getTimerDuration() * 0.965);
Expand All @@ -71,6 +76,7 @@ public void onActivation() {
timers.add(new JTimerUtil(30, true, true) {
@Override
public void onActivation() {
currentScore += 40;
game.spawnEnemy(r.nextInt(scrWidth - 150), y, EntityID.AZ_SNIPER);
if(getTimerDuration() > 8.0) setTimerDuration(getTimerDuration() * 0.95);
}
Expand All @@ -79,6 +85,7 @@ public void onActivation() {
timers.add(new JTimerUtil(50, true, true) {
@Override
public void onActivation() {
currentScore += 50;
game.spawnEnemy(r.nextInt(scrWidth - 150), y, EntityID.AZ_PREDATOR);
if(getTimerDuration() > 10.0) setTimerDuration(getTimerDuration() * 0.92);
}
Expand All @@ -87,13 +94,20 @@ public void onActivation() {
timers.add(new JTimerUtil(200, true, true) {
@Override
public void onActivation() {
currentScore += 250;
game.spawnEnemy(scrWidth / 2 - 90, y, EntityID.AZ_REAPER);
if(getTimerDuration() > 25.0) setTimerDuration(getTimerDuration() * 0.85);
}
});
}

public void setHighScore() {
highScore = 0; // temp
if (currentScore > highScore) {
highScore = currentScore;
}
}

public long getLastScore() {
return currentScore;
}
}
7 changes: 6 additions & 1 deletion core/src/io/thebitspud/astroenvoys/screens/LossScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class LossScreen implements Screen {
private final AstroEnvoys app;
private Stage stage;
private Label title;

public LossScreen(AstroEnvoys app) {
this.app = app;
Expand All @@ -28,7 +29,7 @@ public void show() {

final int midX = Gdx.graphics.getWidth() / 2;

Label title = new Label("Level\nFailed", app.assets.titleStyle);
title = new Label("Level\nFailed", app.assets.titleStyle);
title.setPosition(midX - (title.getPrefWidth() / 2), Gdx.graphics.getHeight() * 0.75f);
title.setAlignment(Align.center);

Expand Down Expand Up @@ -59,6 +60,10 @@ public void onClick() {
app.addSettingsButton(stage);
}

public void setTitleLabel(String text) {
title.setText(text);
}

@Override
public void render(float delta) {
app.renderStage(stage);
Expand Down
2 changes: 2 additions & 0 deletions core/src/io/thebitspud/astroenvoys/screens/PauseScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void onClick() {
restartButton.addListener(new JInputListener() {
@Override
public void onClick() {
app.gameScreen.game.endGame(false);
app.setScreen(app.gameScreen);
app.gameScreen.game.init();
}
Expand All @@ -56,6 +57,7 @@ public void onClick() {
quitButton.addListener(new JInputListener() {
@Override
public void onClick() {
app.gameScreen.game.endGame(false);
app.setScreen(app.levelSelectScreen);
}
});
Expand Down
Binary file added screenshots/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9e13a2

Please sign in to comment.