Skip to content

Commit

Permalink
Final LD submission
Browse files Browse the repository at this point in the history
  • Loading branch information
hnzlmnn committed Aug 29, 2016
1 parent de7cc62 commit 9138b17
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 46 deletions.
2 changes: 0 additions & 2 deletions core/src/de/caffeineaddicted/ld36/CustomStagedScreen.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package de.caffeineaddicted.ld36;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.viewport.Viewport;
import de.caffeineaddicted.sgl.SGL;
import de.caffeineaddicted.sgl.impl.exceptions.ProvidedObjectIsNullException;
Expand Down
11 changes: 5 additions & 6 deletions core/src/de/caffeineaddicted/ld36/actors/ProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@
*/
public class ProgressBar extends Actor {

public enum Direction {
HORIZONTAL, VERTICAL
}

private final Direction direction;
private float percentage;
private Color color = new Color(0, 0, 0, 1);
private boolean staticColor = false;
private final Direction direction;

ProgressBar() {
this(Direction.HORIZONTAL);
}
Expand Down Expand Up @@ -102,4 +97,8 @@ public void draw(Batch batch, float parentAlpha) {

}

public enum Direction {
HORIZONTAL, VERTICAL
}

}
7 changes: 3 additions & 4 deletions core/src/de/caffeineaddicted/ld36/actors/Projectile.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.caffeineaddicted.ld36.actors;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.viewport.Viewport;
import de.caffeineaddicted.ld36.screens.GameScreen;
import de.caffeineaddicted.ld36.utils.DemoModeSaveState;
import de.caffeineaddicted.ld36.utils.MathUtils;
Expand Down Expand Up @@ -83,7 +82,7 @@ public Vector2 nextPosition(Vector2 pos, float delta) {
return new Vector2(newX, newY);
}

private Vector2 unicornMove(Vector2 pos, float delta){
private Vector2 unicornMove(Vector2 pos, float delta) {
float newX = pos.x + type.speed * directionX * delta;
float newY = pos.y;
return new Vector2(newX, newY);
Expand Down Expand Up @@ -135,10 +134,10 @@ public void act(float delta) {
for (Entity entity : entities) {
if (entity instanceof UnitEnemy) {
UnitEnemy enemy = (UnitEnemy) entity;
enemy.receiveDamage(enemy.getHp()+1);
enemy.receiveDamage(enemy.getHp() + 1);
}
}
if( unicornPos.y > SGL.provide(GameScreen.class).stage().getViewWidth()) {
if (unicornPos.y > SGL.provide(GameScreen.class).stage().getViewWidth()) {
finished = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/de/caffeineaddicted/ld36/actors/UnitEnemy.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void act(float delta) {

UnitCastle castle = SGL.provide(DemoModeSaveState.class).provide().getCastle();

if(getX() < castle.getWidth()/3.f) {
if (getX() < castle.getWidth() / 3.f) {
if (alive()) {
castle.receiveDamage(type.damage);
SGL.provide(GameScreen.class).points -= type.points;
Expand Down
22 changes: 11 additions & 11 deletions core/src/de/caffeineaddicted/ld36/actors/UpgradeFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void draw(Batch batch, float parentAlpha) {
SGL.provide(ShapeRenderer.class).end();
Gdx.gl.glDisable(GL20.GL_BLEND);
batch.begin();
if( getWeaponProjectile() != Projectile.Type.Unicorn) {
if (getWeaponProjectile() != Projectile.Type.Unicorn) {
writeText(batch, "Weapon Information:", 0);
writeText(batch, "Name: " + getSelectedWeaponType().name(), 1);
writeText(batch, "Damage: " + getWeaponProjectile().damage, 2);
Expand All @@ -101,13 +101,13 @@ public void draw(Batch batch, float parentAlpha) {
} else {
writeText(batch, "Its pretty but Deadly!", 0);
writeText(batch, "Name: ?", 1);
writeText(batch, "Damage: ?" , 2);
writeText(batch, "Reload Time: ?" , 3);
writeText(batch, "Research Time: ?" , 4);
writeText(batch, "Knockback: ?" , 5);
writeText(batch, "Armor Piercing: ?" , 6);
writeText(batch, "Crit Hit Chance: ?" , 7);
writeText(batch, "Freeze Chance: ?" , 8);
writeText(batch, "Damage: ?", 2);
writeText(batch, "Reload Time: ?", 3);
writeText(batch, "Research Time: ?", 4);
writeText(batch, "Knockback: ?", 5);
writeText(batch, "Armor Piercing: ?", 6);
writeText(batch, "Crit Hit Chance: ?", 7);
writeText(batch, "Freeze Chance: ?", 8);
}
getActor(ACTOR_BUTTON).draw(batch, parentAlpha);
}
Expand All @@ -116,15 +116,15 @@ private Weapon.Type getSelectedWeaponType() {
return SGL.provide(GameScreen.class).getHUD().getWeaponType();
}

private UnitCastle getCastle () {
private UnitCastle getCastle() {
return SGL.provide(GameScreen.class).getCastle();
}

private Weapon.Type.Level getSelectedWeaponTypeLevel () {
private Weapon.Type.Level getSelectedWeaponTypeLevel() {
return getCastle().weapon(getSelectedWeaponType()).type.getLevel(getCastle().weapon(getSelectedWeaponType()).getLevel());
}

private Projectile.Type getWeaponProjectile () {
private Projectile.Type getWeaponProjectile() {
return getSelectedWeaponTypeLevel().projectile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.badlogic.gdx.Input;
import de.caffeineaddicted.ld36.LD36;
import de.caffeineaddicted.ld36.messages.*;
import de.caffeineaddicted.ld36.screens.AboutScreen;
import de.caffeineaddicted.ld36.screens.DemoGameScreen;
import de.caffeineaddicted.ld36.messages.PauseGameMessage;
import de.caffeineaddicted.ld36.messages.ShowMenuScreenMessage;
import de.caffeineaddicted.ld36.messages.ToggleFullscreenMessage;
import de.caffeineaddicted.ld36.screens.GameScreen;
import de.caffeineaddicted.ld36.screens.MenuScreen;
import de.caffeineaddicted.sgl.SGL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package de.caffeineaddicted.ld36.input;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.utils.Pools;
import de.caffeineaddicted.ld36.actors.Actor;
import de.caffeineaddicted.ld36.messages.ShowMenuScreenMessage;
import de.caffeineaddicted.ld36.screens.GameScreen;
import de.caffeineaddicted.ld36.screens.MenuScreen;
import de.caffeineaddicted.sgl.SGL;
import de.caffeineaddicted.sgl.input.SGLInputProcessor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class PauseGameMessage extends Message {
public PauseGameMessage() {
this(true);
}

public PauseGameMessage(boolean pausescreen) {
put("pausescreen", pausescreen);
}
Expand Down
2 changes: 0 additions & 2 deletions core/src/de/caffeineaddicted/ld36/screens/GameScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
import de.caffeineaddicted.ld36.actors.*;
import de.caffeineaddicted.ld36.input.GameInputProcessor;
import de.caffeineaddicted.ld36.messages.GameOverMessage;
import de.caffeineaddicted.ld36.messages.PauseGameMessage;
import de.caffeineaddicted.ld36.utils.DemoModeSaveState;
import de.caffeineaddicted.ld36.utils.MathUtils;
import de.caffeineaddicted.ld36.wave.WaveGenerator;
import de.caffeineaddicted.ld36.wave.WaveGeneratorDefer;
import de.caffeineaddicted.sgl.SGL;
import de.caffeineaddicted.sgl.input.SGLScreenInputMultiplexer;
import de.caffeineaddicted.sgl.messages.Bundle;
import de.caffeineaddicted.sgl.ui.screens.SGLScreen;

import java.lang.reflect.Field;
Expand Down
2 changes: 0 additions & 2 deletions core/src/de/caffeineaddicted/ld36/screens/MenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.viewport.Viewport;
import de.caffeineaddicted.ld36.LD36;
import de.caffeineaddicted.ld36.input.GameInputProcessor;
import de.caffeineaddicted.ld36.input.MenuInputProcessor;
import de.caffeineaddicted.ld36.messages.*;
import de.caffeineaddicted.ld36.ui.UIElement;
Expand Down
20 changes: 10 additions & 10 deletions core/src/de/caffeineaddicted/ld36/weapons/Weapon.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ public void act(float delta) {

public static enum Type {
// TODO: adjust textures
Stone( new Level("Stone", 0.35f, 10f, 0, 70f, false, Projectile.Type.StoneProjectile, "raw/Stone/Combined.png", "raw/Stone/golem1.png", true, 5, 128, 128),
Stone(new Level("Stone", 0.35f, 10f, 0, 70f, false, Projectile.Type.StoneProjectile, "raw/Stone/Combined.png", "raw/Stone/golem1.png", true, 5, 128, 128),
new Level("Stone", 0.28f, 20f, 0, 70f, false, Projectile.Type.StoneProjectile1, "raw/Stone/Combined.png", "raw/Stone/golem1.png", true, 5, 128, 128)),
Bow( new Level("Bow", 0.2f, 30f, 30, 300f, false, Projectile.Type.BowArrow, "raw/arrow/ArchersCombined.png", "raw/arrow/arrow3.png", true, 4, 128, 128),
Bow(new Level("Bow", 0.2f, 30f, 30, 300f, false, Projectile.Type.BowArrow, "raw/arrow/ArchersCombined.png", "raw/arrow/arrow3.png", true, 4, 128, 128),
new Level("Bow", 0.15f, 60f, 30, 300f, false, Projectile.Type.BowArrow1, "raw/arrow/ArchersCombined.png", "raw/arrow/arrow3.png", true, 4, 128, 128)),
Crossbow(new Level("Crossbow", 0.5f, 20f, 2, 300f, false, Projectile.Type.CrossbowBolt, "raw/crossbow/bolt.png", "raw/crossbow/bolt.png", false, 0, 0, 0),
new Level("Crossbow", 0.4f, 40f, 2, 300f, false, Projectile.Type.CrossbowBolt1, "raw/crossbow/bolt.png", "raw/crossbow/bolt.png", false, 0, 0, 0)),
Speer( new Level("Spear", 0.6f, 20f, 3, 100f, false, Projectile.Type.Javelin, "raw/Javelin/Combined.png", "raw/Javelin/Soldier1.png", true, 4, 70, 68),
new Level("Crossbow", 0.4f, 40f, 2, 300f, false, Projectile.Type.CrossbowBolt1, "raw/crossbow/bolt.png", "raw/crossbow/bolt.png", false, 0, 0, 0)),
Speer(new Level("Spear", 0.6f, 20f, 3, 100f, false, Projectile.Type.Javelin, "raw/Javelin/Combined.png", "raw/Javelin/Soldier1.png", true, 4, 70, 68),
new Level("Spear", 0.45f, 40f, 3, 100f, false, Projectile.Type.Javelin1, "raw/Javelin/Combined.png", "raw/Javelin/Soldier1.png", true, 4, 70, 68)),
Shuriken(new Level("Shuriken", 0.15f, 90f, 5, 90f, false, Projectile.Type.Shuriken, "raw/shuriken/Shuriken2.png", "raw/shuriken/Shuriken2.png", false, 0, 0, 0),
new Level("Shuriken", 0.125f, 180f, 5, 90f, false, Projectile.Type.Shuriken1, "raw/shuriken/Shuriken2.png", "raw/shuriken/Shuriken2.png", false, 0, 0, 0)),
new Level("Shuriken", 0.125f, 180f, 5, 90f, false, Projectile.Type.Shuriken1, "raw/shuriken/Shuriken2.png", "raw/shuriken/Shuriken2.png", false, 0, 0, 0)),
Catapult(new Level("Catapult", 2.2f, 90f, 10, 500f, false, Projectile.Type.CatapultAmmo, "raw/catapult/Combined.png", "raw/catapult/step2.png", true, 4, 128, 128),
new Level("Catapult", 1.7f, 180f, 10, 500f, false, Projectile.Type.CatapultAmmo1, "raw/catapult/Combined.png", "raw/catapult/step2.png", true, 4, 128, 128)),
new Level("Catapult", 1.7f, 180f, 10, 500f, false, Projectile.Type.CatapultAmmo1, "raw/catapult/Combined.png", "raw/catapult/step2.png", true, 4, 128, 128)),
Balliste(new Level("Baliste", 2.2f, 180f, 10, 500f, false, Projectile.Type.BallisteArrow, "raw/balliste/Combined.png", "raw/balliste/step3.png", true, 3, 128, 128),
new Level("Baliste", 1.7f, 360f, 10, 500f, false, Projectile.Type.BallisteArrow1, "raw/balliste/Combined.png", "raw/balliste/step3.png", true, 3, 128, 128)),
Cannon( new Level("Cannon", 2.5f, 120f, 12, 500f, false, Projectile.Type.CannonBall, "raw/cannon/Combined.png", "raw/cannon/step1.png", true, 8, 128, 128),
new Level("Baliste", 1.7f, 360f, 10, 500f, false, Projectile.Type.BallisteArrow1, "raw/balliste/Combined.png", "raw/balliste/step3.png", true, 3, 128, 128)),
Cannon(new Level("Cannon", 2.5f, 120f, 12, 500f, false, Projectile.Type.CannonBall, "raw/cannon/Combined.png", "raw/cannon/step1.png", true, 8, 128, 128),
new Level("Cannon", 1.8f, 240f, 12, 500f, false, Projectile.Type.CannonBall1, "raw/cannon/Combined.png", "raw/cannon/step1.png", true, 8, 128, 128)),
ExplosiveBarrel(new Level("Explosive Barrel", 15f, 120f, 15, 80f, false, Projectile.Type.ExplosiveBarrel, "raw/barrel/Barrel.png", "raw/barrel/Barrel.png", false, 0, 0, 0),
new Level("Explosive Barrel", 10f, 240f, 15, 80f, false, Projectile.Type.ExplosiveBarrel1, "raw/barrel/Barrel.png", "raw/barrel/Barrel.png", false, 0, 0, 0)),
new Level("Explosive Barrel", 10f, 240f, 15, 80f, false, Projectile.Type.ExplosiveBarrel1, "raw/barrel/Barrel.png", "raw/barrel/Barrel.png", false, 0, 0, 0)),
Tomahawk(new Level("Tomahawk", 0.7f, 40f, 4, 90f, false, Projectile.Type.Tomahawk, "raw/axe/axe3.png", "raw/axe/axe3.png", false, 0, 0, 0),
new Level("Tomahawk", 0.5f, 80f, 4, 90f, false, Projectile.Type.Tomahawk1, "raw/axe/axe3.png", "raw/axe/axe3.png", false, 0, 0, 0)),
new Level("Tomahawk", 0.5f, 80f, 4, 90f, false, Projectile.Type.Tomahawk1, "raw/axe/axe3.png", "raw/axe/axe3.png", false, 0, 0, 0)),
Trident(new Level("Trident", 1f, 30f, 7, 100f, false, Projectile.Type.Trident, "raw/trident/Trident.png", "raw/trident/Trident.png", false, 0, 0, 0),
new Level("Trident", 0.5f, 60f, 7, 100f, false, Projectile.Type.Trident1, "raw/trident/Trident.png", "raw/trident/Trident.png", false, 0, 0, 0)),
UnicornUlt(new Level("Unicorn Ult", 10f, 420f, 20, 1000f, true, Projectile.Type.Unicorn, "raw/Unicorn.png", "raw/Unicorn.png", false, 0, 0, 0));
Expand Down

0 comments on commit 9138b17

Please sign in to comment.