From 742ff1eafca32a30180a5f4a32f8d3048741b3e2 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 11:01:43 +0100 Subject: [PATCH 01/22] Bugfix: Shield makes player get remaining damage as hp. --- src/de/teamteamteam/spacescooter/entity/LivingEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java index 048cf4b..7d0b3fd 100644 --- a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java @@ -104,7 +104,7 @@ public abstract class LivingEntity extends CollidableEntity implements Hittable return; if (this.shieldPoints > 0) { if (this.shieldPoints < damage) { - this.healthPoints = (damage - this.shieldPoints); + this.healthPoints -= (damage - this.shieldPoints); this.shieldPoints = 0; } else { this.shieldPoints -= damage; From 5610ff78067735f2991108f9d6553f18db40d464 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 11:03:02 +0100 Subject: [PATCH 02/22] Performance: Maybe this fixes very big frame times. --- src/de/teamteamteam/spacescooter/GameFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/teamteamteam/spacescooter/GameFrame.java b/src/de/teamteamteam/spacescooter/GameFrame.java index fa2973d..bf4f8f2 100644 --- a/src/de/teamteamteam/spacescooter/GameFrame.java +++ b/src/de/teamteamteam/spacescooter/GameFrame.java @@ -148,8 +148,8 @@ public class GameFrame extends JFrame { bufferedGraphics.dispose(); } } while (this.bufferStrategy.contentsRestored()); //Redraw in case the VolatileImage was restored - this.bufferStrategy.show(); //Show the drawn image } while (this.bufferStrategy.contentsLost()); //Redraw in case the VolatileImage got lost + this.bufferStrategy.show(); //Show the drawn image Toolkit.getDefaultToolkit().sync(); //Tell the OS to update its graphics of the window. this.frameTime = System.nanoTime() - frameStart; //Update frameTime } From c810d9d966c8ab319320282ad4833453cdc95b1e Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 11:15:48 +0100 Subject: [PATCH 03/22] Bugfix: Level does not care after the last interval ended. --- .../spacescooter/level/Level.java | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index 0509123..9c67e9b 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -84,37 +84,40 @@ public final class Level { public void handleUpdateTick() { //Check whether the current interval is configured int currentIntervalIndex = this.config.getIntervalIndexByCurrentTime(this.levelClock); - if(currentIntervalIndex == -1) return; //Nothing to do - //Fetch the current interval - int[] currentInterval = this.config.intervalList.get(currentIntervalIndex); - int relativeTimeWithinCurrentInterval = this.levelClock - currentInterval[0]; - int intervalLength = currentInterval[1] - currentInterval[0]; - /* - * @see - * Get all the spawnrules for the current interval. - * - 0: Interval this rule belongs to - * - 1: EntityNumber - This helps to find out what Entity to actually spawn. - * - 2: Amount - The amount of Entities to spawn at a time. - * - 3: SpawnRate - The rate at which the Entities are supposed to be spawned. - * - 4: SpawnPosition - percentage of GameConfig.windowHeight - Where the Enemy shall spawn. - */ - for(int[] spawnRule : this.config.spawnRuleList) { - //Skip spawn rules that are not in the current spawn interval. - if(spawnRule[0] != currentIntervalIndex) continue; - //Divide the current interval by spawnrate - int intervalModulus = intervalLength / spawnRule[3]; - //Check whether the spawn rate strikes right now. - if(relativeTimeWithinCurrentInterval % Math.max(1,intervalModulus) == 0) { - //If the rule matches the current time, spawn the configured Entity in the configured amount: - for(int i=0; i + * Get all the spawnrules for the current interval. + * - 0: Interval this rule belongs to + * - 1: EntityNumber - This helps to find out what Entity to actually spawn. + * - 2: Amount - The amount of Entities to spawn at a time. + * - 3: SpawnRate - The rate at which the Entities are supposed to be spawned. + * - 4: SpawnPosition - percentage of GameConfig.windowHeight - Where the Enemy shall spawn. + */ + for(int[] spawnRule : this.config.spawnRuleList) { + //Skip spawn rules that are not in the current spawn interval. + if(spawnRule[0] != currentIntervalIndex) continue; + //Divide the current interval by spawnrate + int intervalModulus = intervalLength / spawnRule[3]; + //Check whether the spawn rate strikes right now. + if(relativeTimeWithinCurrentInterval % Math.max(1,intervalModulus) == 0) { + //If the rule matches the current time, spawn the configured Entity in the configured amount: + for(int i=0; i Date: Tue, 9 Dec 2014 11:15:55 +0100 Subject: [PATCH 04/22] make debug playing easier :p --- res/levels/test.level | 7 ------- 1 file changed, 7 deletions(-) diff --git a/res/levels/test.level b/res/levels/test.level index 2d2d832..c22ddb7 100644 --- a/res/levels/test.level +++ b/res/levels/test.level @@ -6,13 +6,6 @@ background:CloudBackground spawn:EnemyBoss,1,1,50 [1-2] spawn:StoneOne,2,1,0 -spawn:StoneOne,2,1,10 -spawn:StoneTwo,2,1,20 -spawn:StoneOne,2,1,30 -spawn:StoneTwo,2,1,40 -spawn:EnemyOne,2,1,50 -spawn:StoneOne,2,1,60 -spawn:StoneThree,2,1,70 spawn:StoneOne,2,1,80 spawn:StoneThree,2,1,90 spawn:StoneThree,2,1,100 From 73f948b4e1238ca5b46d6ab7fa328be8703dba96 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 11:58:31 +0100 Subject: [PATCH 05/22] Feature: Add centered hitboxes that can have seperate dimensions. --- .../spacescooter/control/Keyboard.java | 4 + .../spacescooter/entity/CollidableEntity.java | 86 +++++++++++++++++++ .../spacescooter/entity/Entity.java | 29 ++++--- .../spacescooter/entity/Player.java | 2 +- .../spacescooter/entity/enemy/Enemy.java | 2 +- .../spacescooter/entity/enemy/EnemyBoss.java | 6 +- .../entity/explosion/ExplosionOne.java | 2 +- .../entity/explosion/ExplosionTwo.java | 2 +- .../spacescooter/entity/item/Item.java | 2 +- .../entity/obstacle/StoneOne.java | 1 + .../entity/obstacle/StoneThree.java | 1 + .../entity/obstacle/StoneTwo.java | 1 + .../spacescooter/entity/shot/BeamImage.java | 1 - .../spacescooter/entity/shot/Shot.java | 4 +- .../spacescooter/entity/spi/Collidable.java | 22 +++-- .../gui/SecondaryWeaponAmount.java | 1 - .../utility/CollisionHandler.java | 20 ++--- 17 files changed, 144 insertions(+), 42 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/control/Keyboard.java b/src/de/teamteamteam/spacescooter/control/Keyboard.java index 104a756..dcb3bc2 100644 --- a/src/de/teamteamteam/spacescooter/control/Keyboard.java +++ b/src/de/teamteamteam/spacescooter/control/Keyboard.java @@ -11,6 +11,7 @@ import de.teamteamteam.spacescooter.entity.enemy.EnemyOne; import de.teamteamteam.spacescooter.entity.enemy.EnemyThree; import de.teamteamteam.spacescooter.entity.enemy.EnemyTwo; import de.teamteamteam.spacescooter.entity.item.ItemNuke; +import de.teamteamteam.spacescooter.screen.GameScreen; /** * This is our main control input source. @@ -126,6 +127,9 @@ public class Keyboard implements KeyListener { if(e.getKeyCode() == KeyEvent.VK_0) { new EnemyBoss(400,400); } + if(e.getKeyCode() == KeyEvent.VK_5) { + GameScreen.getPlayer().setCollide(!GameScreen.getPlayer().canCollide()); + } } diff --git a/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java b/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java index 9fb7712..761780f 100644 --- a/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java @@ -1,5 +1,9 @@ package de.teamteamteam.spacescooter.entity; +import java.awt.Color; +import java.awt.Graphics2D; + +import de.teamteamteam.spacescooter.brain.GameConfig; import de.teamteamteam.spacescooter.entity.spi.Collidable; /** @@ -22,6 +26,16 @@ public abstract class CollidableEntity extends Entity implements Collidable { */ private boolean damaging; + /** + * Height of the hitbox. + */ + private int hitboxHeight; + + /** + * Width of the hitbox. + */ + private int hitboxWidth; + /** * Default constructor. Initializes sane defaults. @@ -32,6 +46,78 @@ public abstract class CollidableEntity extends Entity implements Collidable { this.setDamaging(true); } + /** + * Get X-Position of the Collidable. + */ + public int getHitboxX() { + return this.getCenteredX() - (this.hitboxWidth / 2); + } + + /** + * Get Y-Position of the Collidable. + */ + public int getHitboxY() { + return this.getCenteredY() - (this.hitboxHeight / 2); + } + + /** + * Get the width of the Collidable. + */ + public int getHitboxWidth() { + return this.hitboxWidth; + } + + /** + * Set the width of the Collidable. + */ + public void setHitboxWidth(int hitboxWidth) { + this.hitboxWidth = hitboxWidth; + } + + /** + * Get the height of the Collidable. + */ + public int getHitboxHeight() { + return this.hitboxHeight; + } + + /** + * Set the height of the Collidable. + */ + public void setHitboxHeight(int hitboxHeight) { + this.hitboxHeight = hitboxHeight; + } + + /** + * Set the dimensions of the CollidableEntities hitbox. + */ + public void setHitboxDimenstions(int width, int height) { + this.hitboxWidth = width; + this.hitboxHeight = height; + } + + /** + * Overriding the Entities setImageDimension to (ab)use their width/height + * for reuse in the hitbox. + */ + @Override + public void setImageDimensions(int width, int height) { + super.setImageDimensions(width, height); + this.hitboxWidth = this.getImageWidth(); + this.hitboxHeight = this.getImageHeight(); + } + + /** + * Adding a debugging option to draw the hitbox in red. + */ + @Override + public void paint(Graphics2D g) { + super.paint(g); + if(GameConfig.DEBUG) { + g.setColor(new Color(255,0,0)); + g.drawRect(this.getHitboxX(), this.getHitboxY(), this.hitboxWidth, this.hitboxHeight); + } + } /** * Handle collisions based on what the LivingEntity collided with. diff --git a/src/de/teamteamteam/spacescooter/entity/Entity.java b/src/de/teamteamteam/spacescooter/entity/Entity.java index 75f2fa0..1073d79 100644 --- a/src/de/teamteamteam/spacescooter/entity/Entity.java +++ b/src/de/teamteamteam/spacescooter/entity/Entity.java @@ -53,12 +53,12 @@ public abstract class Entity implements Updateable, Paintable { /** * Entity width. */ - private int width; + private int imageWidth; /** * Entity height. */ - private int height; + private int imageHeight; /** * Whether or not the Entity is able to move using transpose. @@ -106,14 +106,14 @@ public abstract class Entity implements Updateable, Paintable { * Get the centered X-Position of the Entity. */ public int getCenteredX() { - return this.x + (this.width / 2); + return this.x + (this.imageWidth / 2); } /** * Get the centered Y-Position of the Entity. */ public int getCenteredY() { - return this.y + (this.height / 2); + return this.y + (this.imageHeight / 2); } /** @@ -138,23 +138,23 @@ public abstract class Entity implements Updateable, Paintable { /** * Get the Entities width. */ - public int getWidth() { - return this.width; + public int getImageWidth() { + return this.imageWidth; } /** * Get the Entities height. */ - public int getHeight() { - return this.height; + public int getImageHeight() { + return this.imageHeight; } /** * Set the entities width and height. */ - public void setDimensions(int width, int height) { - this.width = width; - this.height = height; + public void setImageDimensions(int width, int height) { + this.imageWidth = width; + this.imageHeight = height; } /** @@ -170,7 +170,7 @@ public abstract class Entity implements Updateable, Paintable { public void setImage(String filename) { this.img = Loader.getBufferedImageByFilename(filename); //set the entities dimensions using the dimensions of the image. - this.setDimensions(this.img.getWidth(), this.img.getHeight()); + this.setImageDimensions(this.img.getWidth(), this.img.getHeight()); } /** @@ -190,11 +190,12 @@ public abstract class Entity implements Updateable, Paintable { /** * The default way to paint the Entity. * Simply draw the Entities image on its current position. + * Debugging option: draw the image border in green. */ public void paint(Graphics2D g) { if(GameConfig.DEBUG) { - g.setColor(new Color(255,0,0)); - g.drawRect(this.x, this.y, this.width, this.height); + g.setColor(new Color(0,255,0)); + g.drawRect(this.x, this.y, this.imageWidth, this.imageHeight); } g.drawImage(this.img, this.x, this.y, null); } diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index c650fcd..721ca0f 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -128,7 +128,7 @@ public class Player extends ShootingEntity implements KeyboardListener { public void paint(Graphics2D g) { if(this.currentCollisionCooldown > 0) { g.setColor(Color.RED); - g.drawRect(this.getX(), this.getY(), this.getWidth(), this.getHeight()); + g.drawRect(this.getX(), this.getY(), this.getImageWidth(), this.getImageHeight()); } super.paint(g); } diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java index cc23a19..39c5dc2 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java @@ -42,7 +42,7 @@ public abstract class Enemy extends ShootingEntity { super.update(); // enemy has fully left the screen ..to the left! - if(this.getX() + this.getWidth() < 0){ + if(this.getX() + this.getImageWidth() < 0){ this.remove(); return; } diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBoss.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBoss.java index b4ea41b..af231d1 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBoss.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBoss.java @@ -44,7 +44,7 @@ public class EnemyBoss extends Enemy{ public void update() { super.update(); //Move into the Screen until it fits on X-Axis - if(this.getX() > GameConfig.gameScreenWidth+GameConfig.gameScreenXOffset-this.getWidth()) { + if(this.getX() > GameConfig.gameScreenWidth+GameConfig.gameScreenXOffset-this.getImageWidth()) { this.transpose(-1, 0); } //Move up or down within the GameScreen. @@ -52,12 +52,12 @@ public class EnemyBoss extends Enemy{ if(this.getY() == GameConfig.gameScreenYOffset){ move = 1; } - if(this.getY() == GameConfig.gameScreenHeight + GameConfig.gameScreenYOffset - this.getHeight()){ + if(this.getY() == GameConfig.gameScreenHeight + GameConfig.gameScreenYOffset - this.getImageHeight()){ move = -1; } //Randomly spawn minions. if(Random.nextInt(1000) < 5) { - new EnemyBossMinion(GameConfig.gameScreenWidth +GameConfig.gameScreenXOffset - this.getWidth(), this.getY()); + new EnemyBossMinion(GameConfig.gameScreenWidth +GameConfig.gameScreenXOffset - this.getImageWidth(), this.getY()); } //Randomly fire doubleshots. if(Random.nextInt(1000) < 50) { diff --git a/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionOne.java b/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionOne.java index 11619af..4f27df7 100644 --- a/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionOne.java +++ b/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionOne.java @@ -17,7 +17,7 @@ public class ExplosionOne extends Animation { "images/explosions/01/explosion7.png" }; this.configure(images, 10); - this.setPosition(x - (this.getWidth()/2), y - (this.getHeight()/2)); + this.setPosition(x - (this.getImageWidth()/2), y - (this.getImageHeight()/2)); SoundSystem.playSound("sounds/bad_explosion1.wav"); } } diff --git a/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionTwo.java b/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionTwo.java index 7ca3797..48348ce 100644 --- a/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionTwo.java +++ b/src/de/teamteamteam/spacescooter/entity/explosion/ExplosionTwo.java @@ -26,7 +26,7 @@ public class ExplosionTwo extends Animation { "images/explosions/02/explosion2_16.png" }; this.configure(images, 10); - this.setPosition(x - (this.getWidth()/2), y - (this.getHeight()/2)); + this.setPosition(x - (this.getImageWidth()/2), y - (this.getImageHeight()/2)); SoundSystem.playSound("sounds/bad_explosion2.wav"); } diff --git a/src/de/teamteamteam/spacescooter/entity/item/Item.java b/src/de/teamteamteam/spacescooter/entity/item/Item.java index ced3250..88020c2 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/Item.java +++ b/src/de/teamteamteam/spacescooter/entity/item/Item.java @@ -38,7 +38,7 @@ public abstract class Item extends CollidableEntity { */ public void update(){ this.transpose(-1, 0); - if(this.getX() < this.getWidth()) { + if(this.getX() < this.getImageWidth()) { this.remove(); } } diff --git a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneOne.java b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneOne.java index 034be47..8c504f1 100644 --- a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneOne.java +++ b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneOne.java @@ -9,6 +9,7 @@ public class StoneOne extends MovingObstacle { super(x, y); this.setImage("images/stones/stone01.png"); this.setCollisionDamage(9001); + this.setHitboxDimenstions(this.getImageWidth() - 5, this.getImageHeight() - 5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneThree.java b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneThree.java index f1b92b4..992bd6b 100644 --- a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneThree.java +++ b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneThree.java @@ -9,6 +9,7 @@ public class StoneThree extends MovingObstacle { super(x, y); this.setImage("images/stones/stone03.png"); this.setCollisionDamage(9001); + this.setHitboxDimenstions(this.getImageWidth() - 5, this.getImageHeight() - 5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneTwo.java b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneTwo.java index 8392b9d..f9bf4ee 100644 --- a/src/de/teamteamteam/spacescooter/entity/obstacle/StoneTwo.java +++ b/src/de/teamteamteam/spacescooter/entity/obstacle/StoneTwo.java @@ -9,6 +9,7 @@ public class StoneTwo extends MovingObstacle { super(x, y); this.setImage("images/stones/stone02.png"); this.setCollisionDamage(9001); + this.setHitboxDimenstions(this.getImageWidth() - 5, this.getImageHeight() - 5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/shot/BeamImage.java b/src/de/teamteamteam/spacescooter/entity/shot/BeamImage.java index 802600b..ad1015f 100644 --- a/src/de/teamteamteam/spacescooter/entity/shot/BeamImage.java +++ b/src/de/teamteamteam/spacescooter/entity/shot/BeamImage.java @@ -15,7 +15,6 @@ public class BeamImage extends Entity { this.setImage("images/shots/beam.png"); } - @Override public void update() { this.lifetime++; if(this.lifetime>30){ diff --git a/src/de/teamteamteam/spacescooter/entity/shot/Shot.java b/src/de/teamteamteam/spacescooter/entity/shot/Shot.java index 1085e76..a32e20f 100644 --- a/src/de/teamteamteam/spacescooter/entity/shot/Shot.java +++ b/src/de/teamteamteam/spacescooter/entity/shot/Shot.java @@ -90,8 +90,8 @@ public class Shot extends CollidableEntity { public void update() { this.transpose(this.direction * this.speed, 0); //remove the shot in case it is out of the game window. - if ((this.getX() + this.getWidth()) < 0 || this.getX() > GameConfig.windowWidth - || (this.getY() + this.getHeight()) < 0 + if ((this.getX() + this.getImageWidth()) < 0 || this.getX() > GameConfig.windowWidth + || (this.getY() + this.getImageHeight()) < 0 || this.getY() > GameConfig.windowHeight) { this.remove(); } diff --git a/src/de/teamteamteam/spacescooter/entity/spi/Collidable.java b/src/de/teamteamteam/spacescooter/entity/spi/Collidable.java index 45202d5..2bad3b5 100644 --- a/src/de/teamteamteam/spacescooter/entity/spi/Collidable.java +++ b/src/de/teamteamteam/spacescooter/entity/spi/Collidable.java @@ -8,22 +8,32 @@ public interface Collidable { /** * Get X-Position of the Collidable. */ - public int getX(); - + public int getHitboxX(); + /** * Get Y-Position of the Collidable. */ - public int getY(); + public int getHitboxY(); /** * Get the width of the Collidable. */ - public int getWidth(); - + public int getHitboxWidth(); + + /** + * Set the width of the Collidable. + */ + public void setHitboxWidth(int hitboxWidth); + /** * Get the height of the Collidable. */ - public int getHeight(); + public int getHitboxHeight(); + + /** + * Set the height of the Collidable. + */ + public void setHitboxHeight(int hitboxHeight); /** * Notify the Collidable that a collision happened. diff --git a/src/de/teamteamteam/spacescooter/gui/SecondaryWeaponAmount.java b/src/de/teamteamteam/spacescooter/gui/SecondaryWeaponAmount.java index c6c6c9a..ba939f2 100644 --- a/src/de/teamteamteam/spacescooter/gui/SecondaryWeaponAmount.java +++ b/src/de/teamteamteam/spacescooter/gui/SecondaryWeaponAmount.java @@ -30,7 +30,6 @@ public class SecondaryWeaponAmount extends Entity{ } } - @Override public void update() {} } diff --git a/src/de/teamteamteam/spacescooter/utility/CollisionHandler.java b/src/de/teamteamteam/spacescooter/utility/CollisionHandler.java index a1d7b48..5dc491e 100644 --- a/src/de/teamteamteam/spacescooter/utility/CollisionHandler.java +++ b/src/de/teamteamteam/spacescooter/utility/CollisionHandler.java @@ -70,18 +70,18 @@ public class CollisionHandler { * Check if two Collidables actually collided. */ private static boolean doCollide(Collidable cOne, Collidable cTwo) { - int x1 = cOne.getX(); - int x2 = cOne.getX() + cOne.getWidth(); - int x3 = cTwo.getX(); - int x4 = cTwo.getX() + cTwo.getWidth(); - int total_width = cOne.getWidth() + cTwo.getWidth(); + int x1 = cOne.getHitboxX(); + int x2 = cOne.getHitboxX() + cOne.getHitboxWidth(); + int x3 = cTwo.getHitboxX(); + int x4 = cTwo.getHitboxX() + cTwo.getHitboxWidth(); + int total_width = cOne.getHitboxWidth() + cTwo.getHitboxWidth(); boolean x_overlap = total_width > Math.abs(Math.max(x2, x4) - Math.min(x1, x3)); - int y1 = cOne.getY(); - int y2 = cOne.getY() + cOne.getHeight(); - int y3 = cTwo.getY(); - int y4 = cTwo.getY() + cTwo.getHeight(); - int total_height = cOne.getHeight() + cTwo.getHeight(); + int y1 = cOne.getHitboxY(); + int y2 = cOne.getHitboxY() + cOne.getHitboxHeight(); + int y3 = cTwo.getHitboxY(); + int y4 = cTwo.getHitboxY() + cTwo.getHitboxHeight(); + int total_height = cOne.getHitboxHeight() + cTwo.getHitboxHeight(); boolean y_overlap = total_height > Math.abs(Math.max(y2, y4) - Math.min(y1, y3)); return x_overlap && y_overlap; From 0f975030f7046bda7a8c82e91b95ae1a63c5654e Mon Sep 17 00:00:00 2001 From: Licht Date: Tue, 9 Dec 2014 12:22:00 +0100 Subject: [PATCH 06/22] Added new Enemy Spaceship --- res/images/ShuttlecraftSpaceship.png | Bin 0 -> 1338 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/images/ShuttlecraftSpaceship.png diff --git a/res/images/ShuttlecraftSpaceship.png b/res/images/ShuttlecraftSpaceship.png new file mode 100644 index 0000000000000000000000000000000000000000..419260036680ae9c31857702732bfb4df0f38982 GIT binary patch literal 1338 zcmV-A1;zS_P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^<` z3lJT7iR2vs000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000D)NklYGExIjf5qn9OT)|zOP~_Zt}pw&d%=a z{^tL@%npZF$Zp=e(Ntf%bLVT0ZSyZPjGm2;T>${>?(QP7_>-oeds#qO7%S@w1dx9G zSO#WQ{@*A(K6VAi1AhEhkTf6f76kg?Af%{yRuH`Md4&)FK=kBETsZ%cMrFrQgQ{cf zc)+hX+=74#A@ZRIOGr^Ztn5e>zIX2%g&P+N`L2fzoml=wK>@(zqc97bSWFnI%qpx_ zTHj@#-T!Z)004-^XJ9L7JrCsS>R+01hKJuVe8+yRrh8pok6Ft+d1BhnS}Z<;U1`TW zX|bSc$ho=iEMIcsL{L88*|9D;=SD{H+wZ>u0M^%2h{b0*mPmV#`HX>$K;3RP?%)4b zZjX$708tbniXuE74@#vHlF1~J$s|eP*s?6c~g8yN)vl*?soZ*S|~@8pdgGSJrt z0B{||yxZx-KbZ`6@_GG*2ZdFG0)Wfql9luOm36Y&Y{KL5002Z$1c0`nSu2;zmY_6= z9qZ}Q+{eP2uC(mHQj;VJsZ>gCQH90f0Ay zwQE#ms<0iEyL{+A7ySKN8 zQmJHXawMr}%bjcWy6#WI9&=xn5L9(mR>*Zz}4rBo*=b z<*SN?$9}CQ1Gk&7)X7S%^y=R$h|Ml=mP^ZaYOoy(hr?(#T53>W3QgnK3fgQU)ZmGq zCRyoJa>YeOX-3uz!PKG+8UG>SRg zJ?qkp-QOSV2)G*fQ2)a;!w(IeX&NaPkA-xft!LL-9}pVE#Bxs4fA?(O6g-#9+n$(P zw?1uB=tFM+sA1`cL-sBHPo|f;6sCG6qV2u%d{L?#k{gV z@!5c)O-L1j;Og9t$D>Cp+|baO=JeD&E`I!;GI1QZ^z_uc0($x_2@}gzIC^?zx7I4` z>PmcfWQ&JF|M Date: Tue, 9 Dec 2014 12:58:13 +0100 Subject: [PATCH 07/22] Adding new Boss Image --- res/images/BossBobaFett.png | Bin 0 -> 25202 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/images/BossBobaFett.png diff --git a/res/images/BossBobaFett.png b/res/images/BossBobaFett.png new file mode 100644 index 0000000000000000000000000000000000000000..5c342c8ef927669dc2e7408e7181bf718b046e1b GIT binary patch literal 25202 zcmV)GK)%0;P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^<` z3pNPXii6Ss03ZNKL_t(|+U&e(u&wD;-}iflci8Wq&OYa!=?;DS-oAaiTWU2e5JD0P z5oG~o$3>A)NySuBskmZNVNl9o3`h)8ERzCEY==0-;JEApSL_0VWrz?q7GO(4QcEq= zlhoa}yYD=laZm5~3@ab@g{q`NNxf<+`_I1lFUVWp`c6ztnT-0c1Ais$ec%6Ga?gnk zg0jqK4r}t)fxlAr!N2`OGPH(a6s{k3EL=oc#p^Nr6|lea_kKdsWrx4HN7{NO+v{lM zNfs>|lktaN2mUhJkN&OyS-KbY*f{J+vvt~yHJZgCENkl05#Tpo4=FE${m=*ACw;v} zcIPG=PMGICmJ%5rH>i1qt2{|mXypFaf&VG(``-7%5=&t`y}>9kbX`l=Ofk!faC(eF z(Yc1CX*fEbzvp$}e+qm5kN<@9mnDO0ikjBcnPpjbxYiMaP%dj2B*d7|l-=t|^G{>% z{h{|sdV9*f%@RFpIVc;JWkcIKIxj3#U|BX~TJUM)8s_z~@J}AI-z$@aW+yC}?zhYr z4K75En@Ag=F`lJF7RyKxVb2G8MqUU0C$S&+;lC-F%jg|Xsk@fxqM{A3)ESp_jgAqk z0wsnJYPNjNsL`bBlh;GapTznMSiibQQa8+&4P6x4;Bc{IDiw{66ulg*W8J}eFK2s_ zQ5A-@$@sfp2mZ&Yvp@J_QrtMEFGB4-E<~DOIP?v51XX+b{Q<+tI>S6;=iYm0je?|L z@6J9V@zU$SzvQ_6L9w%r+$a_c#>`{56KP z>Azlw|DlaX!wa+d;u65${J!_d*7hmJ!;H%}4%nXu9`Yr2xu8sYIMqXS$0%#rlgOR} zZ7fDPcB5lMB{&>AF(s)ywNjup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l7ua;##Po68D1>l zQ^ab*>K^YsLnqYOwX}%p!93zJlmy{jy#g{^JzGM3#y$)0u-tmP*?caMvuYMYa~aI(gIwP%q?NwO$a+) zf8$TDP5%EF-T@LFxfW9OU_GRQvjshS!g405^2Ik_zc%=p{48`c-mU2*LIof9gfJs| xkJq2$t+PvOc<*`!CdSQuzVi0huMK_*{Wq`1oz2J`MUVgh002ovPDHLkV1g5|a(Ms% literal 0 HcmV?d00001 From f4699e28ee51a64c10a54fc3abbc63d29dd933ed Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 13:03:42 +0100 Subject: [PATCH 08/22] adequate rocket damage --- src/de/teamteamteam/spacescooter/entity/ShootingEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java index eb5f471..808049c 100644 --- a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java @@ -251,7 +251,7 @@ public abstract class ShootingEntity extends LivingEntity { this.getY() + this.shootSpawnY, this.shootDirection, this.shootSpeed, - (int) (this.shootDamage*1.2), + (int) (this.shootDamage*5), this. primaryShotImage ); } From ea15be2fd1a6b24fc67c2504d3614efa739ebee4 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 13:07:56 +0100 Subject: [PATCH 09/22] Feature: Proper gameover condition, GameWonScreen, nextLevel works. --- res/levels/second.level | 22 ++++ res/levels/test.level | 1 + .../spacescooter/brain/GameConfig.java | 5 + .../spacescooter/brain/PlayerSession.java | 20 ++++ .../spacescooter/entity/Entity.java | 9 ++ .../spacescooter/entity/ShootingEntity.java | 1 + .../spacescooter/entity/enemy/Enemy.java | 7 -- .../spacescooter/entity/item/Item.java | 3 - .../entity/obstacle/MovingObstacle.java | 1 + .../entity/obstacle/Obstacle.java | 8 ++ .../spacescooter/level/Level.java | 44 +++++++- .../spacescooter/level/LevelConfig.java | 7 ++ .../spacescooter/level/LevelConfigParser.java | 8 ++ .../spacescooter/screen/GameOverScreen.java | 2 +- .../spacescooter/screen/GameScreen.java | 18 +++- .../spacescooter/screen/GameWonScreen.java | 100 ++++++++++++++++++ .../spacescooter/screen/MainMenuScreen.java | 2 +- 17 files changed, 241 insertions(+), 17 deletions(-) create mode 100644 res/levels/second.level create mode 100644 src/de/teamteamteam/spacescooter/screen/GameWonScreen.java diff --git a/res/levels/second.level b/res/levels/second.level new file mode 100644 index 0000000..993e90c --- /dev/null +++ b/res/levels/second.level @@ -0,0 +1,22 @@ +name:Level Zwai! :D +backgroundMusic:music/ScooterFriendsTurbo8Bit.wav +background:EarthBackground +nextLevel: +- +[0-1] +spawn:EnemyBoss,1,1,50 +[1-2] +spawn:StoneOne,2,1,0 +spawn:StoneOne,2,1,80 +spawn:StoneThree,2,1,90 +spawn:StoneThree,2,1,100 +[2-4] +spawn:EnemyOne,1,5,20 +spawn:StoneOne,4,5,50 +[4-10] +spawn:EnemyTwo,1,10,60 +[10-25] +spawn:EnemyThree,2,4,33 +spawn:EnemyTwo,5,6,10 +[25-30] +spawn:EnemyBoss,1,1,50 diff --git a/res/levels/test.level b/res/levels/test.level index c22ddb7..53bec45 100644 --- a/res/levels/test.level +++ b/res/levels/test.level @@ -1,6 +1,7 @@ name:Testlevel \o/ backgroundMusic:music/ScooterFriendsTurbo8Bit.wav background:CloudBackground +nextLevel:levels/second.level - [0-1] spawn:EnemyBoss,1,1,50 diff --git a/src/de/teamteamteam/spacescooter/brain/GameConfig.java b/src/de/teamteamteam/spacescooter/brain/GameConfig.java index 6b2e983..64abe31 100644 --- a/src/de/teamteamteam/spacescooter/brain/GameConfig.java +++ b/src/de/teamteamteam/spacescooter/brain/GameConfig.java @@ -78,6 +78,11 @@ public final class GameConfig { */ public static final int initialPlayerShotDamage = 10; + /** + * The first level the game will start with. + */ + public static final String firstLevel = "levels/test.level"; + /** * Private constructor, this class will never be instantiated. */ diff --git a/src/de/teamteamteam/spacescooter/brain/PlayerSession.java b/src/de/teamteamteam/spacescooter/brain/PlayerSession.java index 1a704d6..458d0b2 100644 --- a/src/de/teamteamteam/spacescooter/brain/PlayerSession.java +++ b/src/de/teamteamteam/spacescooter/brain/PlayerSession.java @@ -57,6 +57,11 @@ public class PlayerSession { */ private static int secondaryWeapon; + /** + * The next level to load for the player. + */ + private static String nextLevel; + /** * Private constructor, this class will never be instantiated. @@ -237,6 +242,19 @@ public class PlayerSession { PlayerSession.secondaryWeapon = secondaryWeapon; } + /** + * Get the next Level the player will play. + */ + public static String getNextLevel() { + return PlayerSession.nextLevel; + } + + /** + * Set the next Level the player will play. + */ + public static void setNextLevel(String nextLevel) { + PlayerSession.nextLevel = nextLevel; + } /** * This will reset all data from the players session. @@ -245,6 +263,7 @@ public class PlayerSession { * (So the next player can start a fresh session.) */ public static void reset() { + PlayerSession.nextLevel = GameConfig.firstLevel; PlayerSession.score = 0; PlayerSession.secondaryWeapon = 1; PlayerSession.credits = 0; @@ -255,4 +274,5 @@ public class PlayerSession { PlayerSession.shipShieldUpgadesBought = 0; PlayerSession.shipShotUpgadesBought = 0; } + } diff --git a/src/de/teamteamteam/spacescooter/entity/Entity.java b/src/de/teamteamteam/spacescooter/entity/Entity.java index 1073d79..40b49ff 100644 --- a/src/de/teamteamteam/spacescooter/entity/Entity.java +++ b/src/de/teamteamteam/spacescooter/entity/Entity.java @@ -200,6 +200,15 @@ public abstract class Entity implements Updateable, Paintable { g.drawImage(this.img, this.x, this.y, null); } + /** + * Make sure an Entity removes itself when off-screen. + */ + public void update() { + if(this.getX() + this.getImageWidth() < 0) { + this.remove(); + } + } + /** * Removes entity from the game by telling the current Screen * to remove it from its list. diff --git a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java index 808049c..ae17cbd 100644 --- a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java @@ -87,6 +87,7 @@ public abstract class ShootingEntity extends LivingEntity { * Update logic making sure that the currentShootDelay is updated. */ public void update() { + super.update(); if(this.currentShootDelay > 0) this.currentShootDelay--; if(this.currentRocketDelay > 0) this.currentRocketDelay--; if(this.currentBeamDelay > 0) this.currentBeamDelay--; diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java index 39c5dc2..5012986 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/Enemy.java @@ -40,13 +40,6 @@ public abstract class Enemy extends ShootingEntity { */ public void update() { super.update(); - - // enemy has fully left the screen ..to the left! - if(this.getX() + this.getImageWidth() < 0){ - this.remove(); - return; - } - if(willShoot == true){ this.shoot(); } diff --git a/src/de/teamteamteam/spacescooter/entity/item/Item.java b/src/de/teamteamteam/spacescooter/entity/item/Item.java index 88020c2..0789175 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/Item.java +++ b/src/de/teamteamteam/spacescooter/entity/item/Item.java @@ -38,9 +38,6 @@ public abstract class Item extends CollidableEntity { */ public void update(){ this.transpose(-1, 0); - if(this.getX() < this.getImageWidth()) { - this.remove(); - } } /** diff --git a/src/de/teamteamteam/spacescooter/entity/obstacle/MovingObstacle.java b/src/de/teamteamteam/spacescooter/entity/obstacle/MovingObstacle.java index 6864d06..ecf7f3f 100644 --- a/src/de/teamteamteam/spacescooter/entity/obstacle/MovingObstacle.java +++ b/src/de/teamteamteam/spacescooter/entity/obstacle/MovingObstacle.java @@ -27,6 +27,7 @@ public abstract class MovingObstacle extends Obstacle { * Make the Obstacle move at its defined X- and Y-Delta. */ public void update() { + super.update(); this.transpose(this.xDelta, this.yDelta); } diff --git a/src/de/teamteamteam/spacescooter/entity/obstacle/Obstacle.java b/src/de/teamteamteam/spacescooter/entity/obstacle/Obstacle.java index ee1db86..988deb7 100644 --- a/src/de/teamteamteam/spacescooter/entity/obstacle/Obstacle.java +++ b/src/de/teamteamteam/spacescooter/entity/obstacle/Obstacle.java @@ -20,5 +20,13 @@ public abstract class Obstacle extends CollidableEntity { public void collideWith(Collidable entity) { } + + /** + * Patch through the update() call. + */ + @Override + public void update() { + super.update(); + } } diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index 9c67e9b..e1d05a9 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -4,16 +4,21 @@ import de.teamteamteam.spacescooter.background.CloudBackground; import de.teamteamteam.spacescooter.background.EarthBackground; import de.teamteamteam.spacescooter.background.StarBackground; import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.brain.PlayerSession; +import de.teamteamteam.spacescooter.datastructure.ConcurrentIterator; import de.teamteamteam.spacescooter.entity.Entity; import de.teamteamteam.spacescooter.entity.Player; +import de.teamteamteam.spacescooter.entity.enemy.Enemy; import de.teamteamteam.spacescooter.entity.enemy.EnemyBoss; import de.teamteamteam.spacescooter.entity.enemy.EnemyOne; import de.teamteamteam.spacescooter.entity.enemy.EnemyThree; import de.teamteamteam.spacescooter.entity.enemy.EnemyTwo; +import de.teamteamteam.spacescooter.entity.obstacle.Obstacle; import de.teamteamteam.spacescooter.entity.obstacle.StoneOne; import de.teamteamteam.spacescooter.entity.obstacle.StoneThree; import de.teamteamteam.spacescooter.entity.obstacle.StoneTwo; import de.teamteamteam.spacescooter.screen.GameScreen; +import de.teamteamteam.spacescooter.screen.Screen; import de.teamteamteam.spacescooter.sound.SoundSystem; import de.teamteamteam.spacescooter.utility.Loader; @@ -54,17 +59,29 @@ public final class Level { */ private int gameOverDelay; + /** + * Tells how the game over has to be interpreted. + * True - player won, False - player lost. + */ + private boolean playerWon; + + /** + * EntityIterator to evaluate the state of all the existing Entities. + */ + private ConcurrentIterator entityIterator; + /** * Constructor creating a LevelConfig based on a given config file. */ public Level(String levelConfig) { this.levelClock = 0; this.isGameOver = false; + this.playerWon = false; this.gameOverDelay = 3; this.config = Loader.getLevelConfigByFilename(levelConfig); + this.entityIterator = Screen.currentScreen.createEntityIterator(); } - /** * Initialize the level based on the LevelConfig attributes. */ @@ -134,10 +151,29 @@ public final class Level { /** * Evaluates things like whether the Player is alive or * - if there is a bossfight - if the boss is dead. + * Also checks whether the player has survived everything (won) */ private void checkGameOverCondition() { if(!GameScreen.getPlayer().isAlive()) { this.isGameOver = true; + this.playerWon = false; + } + int enemyCounter = 0; + int obstacleCounter = 0; + this.entityIterator.reset(); + while(this.entityIterator.hasNext()) { + Entity e = this.entityIterator.next(); + if(e instanceof Enemy) enemyCounter++; + if(e instanceof Obstacle) obstacleCounter++; + } + + //use the currentIntervalIndex to determine whether there are things scheduled to spawn. + int currentIntervalIndex = this.config.getIntervalIndexByCurrentTime(this.levelClock); + if(enemyCounter == 0 && obstacleCounter == 0 && GameScreen.getPlayer().isAlive() && currentIntervalIndex == -1) { + this.isGameOver = true; + this.playerWon = true; + //Update the next Level + PlayerSession.setNextLevel(this.config.nextLevel); } } @@ -149,6 +185,12 @@ public final class Level { return (this.gameOverDelay == 0); } + /** + * Tell whether the player won the game. + */ + public boolean playerHasWon() { + return this.playerWon; + } /** * Clean up before the Level is torn down. diff --git a/src/de/teamteamteam/spacescooter/level/LevelConfig.java b/src/de/teamteamteam/spacescooter/level/LevelConfig.java index 9a53c88..72181a8 100644 --- a/src/de/teamteamteam/spacescooter/level/LevelConfig.java +++ b/src/de/teamteamteam/spacescooter/level/LevelConfig.java @@ -28,6 +28,11 @@ public class LevelConfig { */ public String backgroundMusic; + /** + * The name of the level that will come after this one. + */ + public String nextLevel; + /** * Intervals have a start and an end. * They are put within this list in a sorted manner, ascending in values. @@ -62,6 +67,8 @@ public class LevelConfig { sb.append(this.background); sb.append(" backgroundMusic="); sb.append(this.backgroundMusic); + sb.append(" nextLevelName="); + sb.append(this.nextLevel); sb.append("\\\n\tRules:\n"); for(int[] rule : this.spawnRuleList) { sb.append("\t"); diff --git a/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java b/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java index 8041ac9..84727a0 100644 --- a/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java +++ b/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java @@ -70,6 +70,8 @@ public class LevelConfigParser { this.levelConfig.background = linePieces[1]; } else if (linePieces[0].equals("backgroundMusic")) { this.levelConfig.backgroundMusic = linePieces[1]; + } else if (linePieces[0].equals("nextLevel")) { + this.levelConfig.nextLevel = linePieces[1]; } else { throw new LevelConfigException("[LevelConfigParser] Unknown attribute in line: '" + line + "'"); } @@ -104,6 +106,12 @@ public class LevelConfigParser { throw new LevelConfigException("[LevelConfigParser] Where am i?!"); } } + + //Set the nextLevel to null explicitly, so it is easy to detect. + if(this.levelConfig.nextLevel.equals("")) { + this.levelConfig.nextLevel = null; + } + return this.levelConfig; } diff --git a/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java b/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java index 6386598..f015177 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameOverScreen.java @@ -94,7 +94,7 @@ public class GameOverScreen extends Screen { } else if(this.animationStatus == 2) { switch (this.menuPoint) { case 0: - this.parent.setOverlay(new GameScreen(this.parent, "levels/test.level")); + this.parent.setOverlay(new GameScreen(this.parent)); break; case 1: this.parent.setOverlay(new MainMenuScreen(this.parent)); diff --git a/src/de/teamteamteam/spacescooter/screen/GameScreen.java b/src/de/teamteamteam/spacescooter/screen/GameScreen.java index 18ce787..9584ac6 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameScreen.java @@ -3,6 +3,7 @@ package de.teamteamteam.spacescooter.screen; import java.awt.Graphics2D; import java.awt.event.KeyEvent; +import de.teamteamteam.spacescooter.brain.PlayerSession; import de.teamteamteam.spacescooter.control.Keyboard; import de.teamteamteam.spacescooter.entity.Player; import de.teamteamteam.spacescooter.gui.HealthBar; @@ -37,9 +38,9 @@ public class GameScreen extends Screen { * GameScreen Constructor. * Takes the level as its second parameter. */ - public GameScreen(Screen parent, String levelConfigName) { + public GameScreen(Screen parent) { super(parent); - this.level = new Level(levelConfigName); + this.level = new Level(PlayerSession.getNextLevel()); this.level.doBuildUp(); //Have the level build up the whole setting. this.gameClockTrigger = 0; @@ -89,9 +90,18 @@ public class GameScreen extends Screen { this.setOverlay(new GamePausedScreen(this), false); } - //Go to GameOverScreen if the game is actually over. + //React if the game is actually over. if (this.level.isGameOver()) { - this.parent.setOverlay(new GameOverScreen(this.parent)); + if(this.level.playerHasWon()) { + if(PlayerSession.getNextLevel() == null) { + System.out.println("You beat the game! TODO: Transition to HighscoreScreen now!"); + } + //Go to the I don't know yet Screen if the game is over and the player WON. + this.parent.setOverlay(new GameWonScreen(this.parent)); + } else { + //Go to GameOverScreen if the game is over - the player died and lost the game. + this.parent.setOverlay(new GameOverScreen(this.parent)); + } } } diff --git a/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java new file mode 100644 index 0000000..4fc00b2 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java @@ -0,0 +1,100 @@ +package de.teamteamteam.spacescooter.screen; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.event.KeyEvent; +import java.awt.image.BufferedImage; + +import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.control.Keyboard; +import de.teamteamteam.spacescooter.entity.Player; +import de.teamteamteam.spacescooter.gui.Button; +import de.teamteamteam.spacescooter.utility.Loader; + +/** + * This Screen is shown after the player has beaten a level, so he can enter the shop + * and do some various things before entering the next level. + */ +public class GameWonScreen extends Screen { + + private BufferedImage img; + private Player player; + private float playerMoveSpeed = 0; + private int colorValue = 0; + private boolean colorValueIncrease = true; + private int menuPoint = 0; + private int animationStatus = 0; //0 = Noch nicht gestartet, 1 = Animation läuft, 2 = Animation beendet + + public GameWonScreen(Screen parent) { + super(parent); + this.img = Loader.getBufferedImageByFilename("images/pausebackground.png"); + new Button(GameConfig.windowWidth/2-125, 300); + new Button(GameConfig.windowWidth/2-125, 400); + player = new Player(GameConfig.windowWidth/2-170, 309); + player.setCanMove(false); + player.setCanShoot(false); + } + + @Override + protected void paint(Graphics2D g) { + g.drawImage(this.img, 0, 0, null); + this.entityPaintIterator.reset(); + while (this.entityPaintIterator.hasNext()) { + this.entityPaintIterator.next().paint(g); + } + g.setFont(new Font("Monospace", 0, 100)); + g.setColor(new Color(75 + colorValue, 175 + colorValue, 175 + colorValue)); + g.drawString("You win!", GameConfig.windowWidth/2-290, 200); + g.setFont(new Font("Monospace", 0, 20)); + g.setColor(new Color(0, 0, 0)); + g.drawString("Weiter zum nächsten Abenteuer! :D", GameConfig.windowWidth/2-60, 332); + g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-60, 432); + } + + @Override + protected void update() { + this.entityUpdateIterator.reset(); + while (this.entityUpdateIterator.hasNext()) { + this.entityUpdateIterator.next().update(); + } + + if(this.colorValueIncrease) { + this.colorValue += 2; + if(this.colorValue > 70) this.colorValueIncrease = false; + } else { + this.colorValue -= 2; + if(this.colorValue < -70) this.colorValueIncrease = true; + } + + if(Keyboard.isKeyDown(KeyEvent.VK_DOWN) && this.animationStatus == 0){ + this.menuPoint = 1; + player.setPosition(player.getX(), 409); + } + if(Keyboard.isKeyDown(KeyEvent.VK_UP) && this.animationStatus == 0){ + this.menuPoint = 0; + player.setPosition(player.getX(), 309); + } + + // make a selection + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { + this.animationStatus = 1; + } + if(this.animationStatus == 1) { + if(player.getX() <= GameConfig.windowWidth) { + player.setPosition(player.getX() + (int) playerMoveSpeed, player.getY()); + playerMoveSpeed += 0.1; + } else this.animationStatus = 2; + } else if(this.animationStatus == 2) { + switch (this.menuPoint) { + case 0: + this.parent.setOverlay(new GameScreen(this.parent)); + break; + case 1: + this.parent.setOverlay(new MainMenuScreen(this.parent)); + break; + } + } + } + +} diff --git a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java index ce23576..31c5394 100644 --- a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java @@ -99,7 +99,7 @@ public class MainMenuScreen extends Screen { } else if(animationStatus == 2) { switch (menuPoint) { case 0: - this.parent.setOverlay(new GameScreen(this.parent, "levels/test.level")); + this.parent.setOverlay(new GameScreen(this.parent)); break; case 1: this.parent.setOverlay(new ShopScreen(this.parent)); From ced2501c8493332e310d66fcce000d01f3c5cefd Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 13:20:00 +0100 Subject: [PATCH 10/22] balancing --- .../teamteamteam/spacescooter/entity/enemy/EnemyBossMinion.java | 2 +- src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java | 2 +- src/de/teamteamteam/spacescooter/entity/enemy/EnemyOne.java | 2 +- src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java | 2 +- src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java | 2 +- src/de/teamteamteam/spacescooter/entity/item/Item.java | 2 +- src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBossMinion.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBossMinion.java index 155a1be..969e24d 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBossMinion.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyBossMinion.java @@ -16,7 +16,7 @@ public class EnemyBossMinion extends Enemy{ this.setImage("images/enemybossminion.png"); this.setPrimaryShotImage("images/shots/laser_green.png"); this.setShootSpeed(4); - this.setShootDelay(42); + this.setShootDelay(30); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setHealthPoints(15); diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java index 1a2ddd2..36aa40c 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java @@ -21,7 +21,7 @@ public class EnemyFour extends Enemy{ this.setImage("images/enemy01.png"); this.setPrimaryShotImage("images/shots/laser_yellow.png"); this.setShootSpeed(4); - this.setShootDelay(42); + this.setShootDelay(62); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setCollisionDamage(5); diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyOne.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyOne.java index 5520a0e..e403de8 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyOne.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyOne.java @@ -9,7 +9,7 @@ public class EnemyOne extends Enemy { this.setImage("images/nyancat.png"); this.setPrimaryShotImage("images/shots/laser_red.png"); this.setShootSpeed(2); - this.setShootDelay(42); + this.setShootDelay(62); this.setShootSpawn(-8, 10); this.setShootDamage(5); this.setCollisionDamage(5); diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java index 435373e..8c0f3d4 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyThree.java @@ -16,7 +16,7 @@ public class EnemyThree extends Enemy{ this.setImage("images/enemy03.png"); this.setPrimaryShotImage("images/shots/laser_red.png"); this.setShootSpeed(4); - this.setShootDelay(42); + this.setShootDelay(62); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setHealthPoints(15); diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java index bdef067..67323bd 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java @@ -9,7 +9,7 @@ public class EnemyTwo extends Enemy{ this.setImage("images/enemy02.png"); this.setPrimaryShotImage("images/shots/laser_green.png"); this.setShootSpeed(4); - this.setShootDelay(42); + this.setShootDelay(62); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setCollisionDamage(5); diff --git a/src/de/teamteamteam/spacescooter/entity/item/Item.java b/src/de/teamteamteam/spacescooter/entity/item/Item.java index 88020c2..84f7507 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/Item.java +++ b/src/de/teamteamteam/spacescooter/entity/item/Item.java @@ -60,7 +60,7 @@ public abstract class Item extends CollidableEntity { int[] items = new int[6]; items[0] = 1; //ItemNuke items[1] = 4; //ItemCredit - items[2] = 2; //ItemHeal + items[2] = 3; //ItemHeal items[3] = 2; //ItemShield items[4] = 2; //ItemRocket or ItemBeam items[5] = 3; //ItemIncreaseDamage diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java b/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java index e9fe589..7e0582d 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java @@ -11,6 +11,6 @@ public class ItemHeal extends Item { @Override public void itemCollected(Player player) { - player.addHealthPoints(15); + player.addHealthPoints(20); } } From d12d00d1b2caa5781d2bea9b52f5edbc1edcebe0 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 13:45:52 +0100 Subject: [PATCH 11/22] Rename attributes of PlayerSession. --- .../spacescooter/brain/PlayerSession.java | 84 +++++++++---------- .../spacescooter/entity/Player.java | 12 +-- .../entity/item/ItemIncreaseDamage.java | 9 +- .../spacescooter/screen/ShopScreen.java | 18 ++-- 4 files changed, 65 insertions(+), 58 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/brain/PlayerSession.java b/src/de/teamteamteam/spacescooter/brain/PlayerSession.java index 458d0b2..56d9787 100644 --- a/src/de/teamteamteam/spacescooter/brain/PlayerSession.java +++ b/src/de/teamteamteam/spacescooter/brain/PlayerSession.java @@ -21,34 +21,34 @@ public class PlayerSession { * Damage value of the normal Shots the ship fires. * This can be changed by upgrades in the shop. */ - private static int shipShotDamage; + private static int baseShotDamage; /** * The ships default maximum shield points. * This can be changed by upgrades in the shop. */ - private static int shipShieldPoints; + private static int baseShieldPoints; /** * The ships default maximum health points. * This can be changed by upgrades in the shop. */ - private static int shipHealthPoints; + private static int baseHealthPoints; /** * The number of health upgrades the player bought for the ship. */ - private static int shipHealthUpgadesBought; + private static int baseHealthUpgadesBought; /** * The number of shield upgrades the player bought for the ship. */ - private static int shipShieldUpgadesBought; + private static int baseShieldUpgadesBought; /** * The number of shot damage upgrades the player bought for the ship. */ - private static int shipShotUpgadesBought; + private static int baseShotUpgadesBought; /** * The secondary weapon of the ship. @@ -126,106 +126,106 @@ public class PlayerSession { /** * Get the ships maximum health points. */ - public static int getShipHealthPoints() { - return PlayerSession.shipHealthPoints; + public static int getBaseHealthPoints() { + return PlayerSession.baseHealthPoints; } /** * Set the ships maximum health points. */ - public static void setShipHealthPoints(int shipHealthPoints) { - PlayerSession.shipHealthPoints = shipHealthPoints; + public static void setBaseHealthPoints(int baseHealthPoints) { + PlayerSession.baseHealthPoints = baseHealthPoints; } /** * Add to the ships maximum health points. */ - public static void addShipHealthPoints(int shipHealthPoints) { - PlayerSession.shipHealthPoints += shipHealthPoints; + public static void addBaseHealthPoints(int baseHealthPoints) { + PlayerSession.baseHealthPoints += baseHealthPoints; } /** * Get the ships maximum shield points. */ - public static int getShipShieldPoints() { - return PlayerSession.shipShieldPoints; + public static int getBaseShieldPoints() { + return PlayerSession.baseShieldPoints; } /** * Set the ships maximum shield points. */ - public static void setShipShieldPoints(int shipShieldPoints) { - PlayerSession.shipShieldPoints = shipShieldPoints; + public static void setBaseShieldPoints(int baseShieldPoints) { + PlayerSession.baseShieldPoints = baseShieldPoints; } /** * Add to the ships maximum shield points. */ - public static void addShipShieldPoints(int shipShieldPoints) { - PlayerSession.shipShieldPoints += shipShieldPoints; + public static void addBaseShieldPoints(int baseShieldPoints) { + PlayerSession.baseShieldPoints += baseShieldPoints; } /** * Get the ships shot damage value. */ - public static int getShipShotDamage() { - return PlayerSession.shipShotDamage; + public static int getBaseShotDamage() { + return PlayerSession.baseShotDamage; } /** * Set the ships shot damage value. */ - public static void setShipShotDamage(int shipShotDamage) { - PlayerSession.shipShotDamage = shipShotDamage; + public static void setBaseShotDamage(int baseShotDamage) { + PlayerSession.baseShotDamage = baseShotDamage; } /** * Add to the ships shot damage value. */ - public static void addShipShotDamage(int shipShotDamage) { - PlayerSession.shipShotDamage += shipShotDamage; + public static void addBaseShotDamage(int shipShotDamage) { + PlayerSession.baseShotDamage += shipShotDamage; } /** * Get the number of ship health upgrades the player bought in the shop. */ - public static int getShipHealthUpgradesBought() { - return PlayerSession.shipHealthUpgadesBought; + public static int getBaseHealthUpgradesBought() { + return PlayerSession.baseHealthUpgadesBought; } /** * Increment the number of ship health upgrades the player bought. */ - public static void incrementShipHealthUpgradesBought() { - PlayerSession.shipHealthUpgadesBought++; + public static void incrementBaseHealthUpgradesBought() { + PlayerSession.baseHealthUpgadesBought++; } /** * Get the number of ship shield upgrades the player bought in the shop. */ - public static int getShipShieldUpgradesBought() { - return PlayerSession.shipShieldUpgadesBought; + public static int getBaseShieldUpgradesBought() { + return PlayerSession.baseShieldUpgadesBought; } /** * Increment the number of ship shield upgrades the player bought. */ - public static void incrementShipShieldUpgradesBought() { - PlayerSession.shipShieldUpgadesBought++; + public static void incrementBaseShieldUpgradesBought() { + PlayerSession.baseShieldUpgadesBought++; } /** * Get the number of ship shot upgrades the player bought in the shop. */ - public static int getShipShotUpgradesBought() { - return PlayerSession.shipShotUpgadesBought; + public static int getBaseShotUpgradesBought() { + return PlayerSession.baseShotUpgadesBought; } /** * Increment the number of ship shot upgrades the player bought. */ - public static void incrementShipShotUpgradesBought() { - PlayerSession.shipShotUpgadesBought++; + public static void incrementBaseShotUpgradesBought() { + PlayerSession.baseShotUpgadesBought++; } /** @@ -267,12 +267,12 @@ public class PlayerSession { PlayerSession.score = 0; PlayerSession.secondaryWeapon = 1; PlayerSession.credits = 0; - PlayerSession.shipHealthPoints = GameConfig.initialPlayerHealthPoints; - PlayerSession.shipShieldPoints = GameConfig.initialPlayerShieldPoints; - PlayerSession.shipShotDamage = GameConfig.initialPlayerShotDamage; - PlayerSession.shipHealthUpgadesBought = 0; - PlayerSession.shipShieldUpgadesBought = 0; - PlayerSession.shipShotUpgadesBought = 0; + PlayerSession.baseHealthPoints = GameConfig.initialPlayerHealthPoints; + PlayerSession.baseShieldPoints = GameConfig.initialPlayerShieldPoints; + PlayerSession.baseShotDamage = GameConfig.initialPlayerShotDamage; + PlayerSession.baseHealthUpgadesBought = 0; + PlayerSession.baseShieldUpgadesBought = 0; + PlayerSession.baseShotUpgadesBought = 0; } } diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index 721ca0f..79a5e63 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -66,11 +66,11 @@ public class Player extends ShootingEntity implements KeyboardListener { this.setShootSpeed(10); this.setCollisionDamage(5); this.setScore(0); - this.setHealthPoints(PlayerSession.getShipHealthPoints()); - this.setMaximumHealthPoints(PlayerSession.getShipHealthPoints()); - this.setShieldPoints(PlayerSession.getShipShieldPoints()); - this.setMaximumShieldPoints(PlayerSession.getShipShieldPoints()); - this.setShootDamage((PlayerSession.getShipShotDamage())/2); + this.setHealthPoints(PlayerSession.getBaseHealthPoints()); + this.setMaximumHealthPoints(PlayerSession.getBaseHealthPoints()); + this.setShieldPoints(PlayerSession.getBaseShieldPoints()); + this.setMaximumShieldPoints(PlayerSession.getBaseShieldPoints()); + this.setShootDamage(PlayerSession.getBaseShotDamage()); this.registerOnKeyboard(Keyboard.getInstance()); } @@ -175,7 +175,7 @@ public class Player extends ShootingEntity implements KeyboardListener { } super.remove(); } - + /** * keyPressed method, comes in handy when a key on the keyboard is pressed */ diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java b/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java index 06240e8..e39bbb0 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java @@ -10,9 +10,16 @@ public class ItemIncreaseDamage extends Item { this.setImage("images/items/item.png"); } + /** + * Increase shoot damage of Player if not above 25. + */ @Override public void itemCollected(Player player) { - player.setShootDamage(player.getShootDamage()+5); + if(player.getShootDamage() > 25) { + return; + } else { + player.setShootDamage(player.getShootDamage()+5); + } } } diff --git a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java index 418a332..6bc9d03 100644 --- a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java @@ -35,9 +35,9 @@ public class ShopScreen extends Screen { super(parent); this.img = Loader.getBufferedImageByFilename("images/shopbackground.png"); new Button(GameConfig.windowWidth/2-125, 500); - damage = new ShopOffer(100, 150, 15, PlayerSession.getShipShotUpgradesBought(), "Schaden 5C"); - shield = new ShopOffer(100, 225, 15, PlayerSession.getShipShieldUpgradesBought(), "Schild 10C"); - life = new ShopOffer(100, 300, 15, PlayerSession.getShipHealthUpgradesBought(), "Leben 10C"); + damage = new ShopOffer(100, 150, 15, PlayerSession.getBaseShotUpgradesBought(), "Schaden 5C"); + shield = new ShopOffer(100, 225, 15, PlayerSession.getBaseShieldUpgradesBought(), "Schild 10C"); + life = new ShopOffer(100, 300, 15, PlayerSession.getBaseHealthUpgradesBought(), "Leben 10C"); new ImageEntity(GameConfig.windowWidth / 2 - 120, 365, "images/shop/shoprocket.png"); new ImageEntity(GameConfig.windowWidth / 2 + 30, 365, "images/shop/shopbeam.png"); if(PlayerSession.getSecondsecondaryWeapon() == 1){ @@ -106,24 +106,24 @@ public class ShopScreen extends Screen { case 0: if(PlayerSession.getCredits() >= 5 && damage.getBought() < damage.getMax()){ damage.buy(); - PlayerSession.addShipShotDamage(5); - PlayerSession.incrementShipShotUpgradesBought(); + PlayerSession.addBaseShotDamage(5); + PlayerSession.incrementBaseShotUpgradesBought(); PlayerSession.removeCredits(5); } break; case 1: if(PlayerSession.getCredits() >= 10 && shield.getBought() < shield.getMax()){ shield.buy(); - PlayerSession.addShipShieldPoints(10); - PlayerSession.incrementShipShieldUpgradesBought(); + PlayerSession.addBaseShieldPoints(10); + PlayerSession.incrementBaseShieldUpgradesBought(); PlayerSession.removeCredits(10); } break; case 2: if(PlayerSession.getCredits() >= 10 && life.getBought() < life.getMax()){ life.buy(); - PlayerSession.addShipHealthPoints(10); - PlayerSession.incrementShipHealthUpgradesBought(); + PlayerSession.addBaseHealthPoints(10); + PlayerSession.incrementBaseHealthUpgradesBought(); PlayerSession.removeCredits(10); } break; From 8621e07e3c6aeb5171ba49d987477fe2bc661983 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 14:01:40 +0100 Subject: [PATCH 12/22] Feature: Prototype for Fscking hardcore mode background. --- .../background/FuckedUpCloudBackground.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/de/teamteamteam/spacescooter/background/FuckedUpCloudBackground.java diff --git a/src/de/teamteamteam/spacescooter/background/FuckedUpCloudBackground.java b/src/de/teamteamteam/spacescooter/background/FuckedUpCloudBackground.java new file mode 100644 index 0000000..a636c16 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/background/FuckedUpCloudBackground.java @@ -0,0 +1,38 @@ +package de.teamteamteam.spacescooter.background; + +import java.awt.Graphics2D; + +import de.teamteamteam.spacescooter.brain.GameConfig; + +public class FuckedUpCloudBackground extends ScrollingBackground { + + private double x; + private double x_delta; + private int percentage; + private int timer; + + public FuckedUpCloudBackground(int x, int y) { + super(x, y); + this.setImage("images/cloudbackground.png"); + this.setScrollingSpeed(-1); + } + + public void paint(Graphics2D g) { + g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight); + /*if(this.timer == 0 && this.percentage < 100) { + this.percentage++; + } else if (timer > 500 && this.percentage > 0) { + this.percentage--; + } else if (this.percentage == 100){ + this.timer++; + } else if (this.percentage == 0) { + this.timer--; + }*/ + this.x += 0.005; + + + g.rotate(this.x, GameConfig.windowWidth/2, GameConfig.windowHeight/2); + super.paint(g); + } + +} From 68cdeddb7353c827285fd00f26187daa7cd1b327 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 14:04:19 +0100 Subject: [PATCH 13/22] encasing that thread work time takes too long in DEBUG --- .../spacescooter/thread/TimedThread.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/thread/TimedThread.java b/src/de/teamteamteam/spacescooter/thread/TimedThread.java index cbb4c15..1815364 100644 --- a/src/de/teamteamteam/spacescooter/thread/TimedThread.java +++ b/src/de/teamteamteam/spacescooter/thread/TimedThread.java @@ -1,5 +1,7 @@ package de.teamteamteam.spacescooter.thread; +import de.teamteamteam.spacescooter.brain.GameConfig; + /** * Since things like drawing the next image or triggering the next game tick * need to happen in time, this TimedThread allows more precise timing @@ -18,11 +20,6 @@ public abstract class TimedThread extends Thread { */ private long workTime; - /** - * This is a quick hack :) - */ - private long runloops; - /** * This method sets the actual working interval based on hz. * @@ -37,7 +34,6 @@ public abstract class TimedThread extends Thread { */ public final void run() { while (true) { - this.runloops++; long workStart = System.nanoTime(); // do the actual work this.work(); @@ -47,9 +43,8 @@ public abstract class TimedThread extends Thread { long timeToWait = this.workInterval - workTime; //in case we are already running late, just print a warning and carry on! - if(timeToWait < 0 && this.runloops > 50) { // runloops for filtering out game start delays - System.err.println("[" + this.getName() + "] workTime exceeds workInterval!:" + this.workTime + " > " + this.workInterval); - runloops = 100; // overflow protect + if(timeToWait < 0) { + if(GameConfig.DEBUG) System.err.println("[" + this.getName() + "] workTime exceeds workInterval!:" + this.workTime + " > " + this.workInterval); continue; } long msToWait = timeToWait / 1000000; From 7c6676f6d52a8aac53a995e1a2ecf42e5665675e Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 14:15:21 +0100 Subject: [PATCH 14/22] bugfixes / gamewonscreen --- src/de/teamteamteam/spacescooter/screen/GameWonScreen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java index 4fc00b2..f243742 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java @@ -45,10 +45,10 @@ public class GameWonScreen extends Screen { } g.setFont(new Font("Monospace", 0, 100)); g.setColor(new Color(75 + colorValue, 175 + colorValue, 175 + colorValue)); - g.drawString("You win!", GameConfig.windowWidth/2-290, 200); + g.drawString("You win!", GameConfig.windowWidth/2-210, 200); g.setFont(new Font("Monospace", 0, 20)); g.setColor(new Color(0, 0, 0)); - g.drawString("Weiter zum nächsten Abenteuer! :D", GameConfig.windowWidth/2-60, 332); + g.drawString("Forwards Ever!", GameConfig.windowWidth/2-70, 332); g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-60, 432); } From 9cd809b4a31099a23b1e7983599806a46c86ed98 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 14:36:05 +0100 Subject: [PATCH 15/22] added shotpowerup image and used it, replaing item.png --- .../spacescooter/entity/item/ItemIncreaseDamage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java b/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java index e39bbb0..49ed8e8 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemIncreaseDamage.java @@ -6,8 +6,7 @@ public class ItemIncreaseDamage extends Item { public ItemIncreaseDamage(int x, int y) { super(x, y); - //TODO: Change Image - this.setImage("images/items/item.png"); + this.setImage("images/items/itemShotPowerUp.png"); } /** From 130152aba0c3b97da073454d1e0c0b0cc69ec43b Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 15:01:35 +0100 Subject: [PATCH 16/22] Feature: Levelname wird bei Levelbeginn eingeblendet. --- .../spacescooter/gui/LevelHeadline.java | 56 +++++++++++++++++++ .../spacescooter/level/Level.java | 5 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/de/teamteamteam/spacescooter/gui/LevelHeadline.java diff --git a/src/de/teamteamteam/spacescooter/gui/LevelHeadline.java b/src/de/teamteamteam/spacescooter/gui/LevelHeadline.java new file mode 100644 index 0000000..fff32f5 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/gui/LevelHeadline.java @@ -0,0 +1,56 @@ +package de.teamteamteam.spacescooter.gui; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; + +import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.entity.Entity; + +/** + * A headline that is being displayed at the beginning of each level, + * disappearing by fading out after 1-2 seconds. + */ +public class LevelHeadline extends Entity { + + + private int lifeTime; + private int lifeTimeCounter; + + private String text; + + public LevelHeadline(int x, int y, String text) { + super(x, y); + this.text = text; + this.lifeTime = 150; + this.lifeTimeCounter = this.lifeTime; + } + + /** + * Make the headline stay for a while, then let it disappear. + */ + @Override + public void update() { + if(this.lifeTimeCounter > 0) { + this.lifeTimeCounter--; + } + if(lifeTime == 0) { + this.remove(); + } + } + + /** + * Draw the Headline + */ + public void paint(Graphics2D g) { + g.setFont(new Font("Monospace", 0, 60)); + float alpha = (float) (this.lifeTimeCounter / (this.lifeTime * 1.0)); + int textWidth = g.getFontMetrics().stringWidth(this.text); + int textHeight = g.getFontMetrics().getHeight(); + int x = (GameConfig.gameScreenWidth/2 - textWidth/2); + int y = (int) (GameConfig.gameScreenHeight/2 - textHeight); + g.setColor(new Color(1.0F, 1.0F, 1.0F, alpha)); + g.drawString(this.text, x, y); + } + +} diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index e1d05a9..e952002 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -17,6 +17,7 @@ import de.teamteamteam.spacescooter.entity.obstacle.Obstacle; import de.teamteamteam.spacescooter.entity.obstacle.StoneOne; import de.teamteamteam.spacescooter.entity.obstacle.StoneThree; import de.teamteamteam.spacescooter.entity.obstacle.StoneTwo; +import de.teamteamteam.spacescooter.gui.LevelHeadline; import de.teamteamteam.spacescooter.screen.GameScreen; import de.teamteamteam.spacescooter.screen.Screen; import de.teamteamteam.spacescooter.sound.SoundSystem; @@ -83,12 +84,14 @@ public final class Level { } /** - * Initialize the level based on the LevelConfig attributes. + * Initialize the level based on the LevelConfig attributes, + * show the level name in a LevelHeadline. */ public void doBuildUp() { this.spawnEntityByAvailableName(Entity.availableNames.valueOf(this.config.background), 0, 50); GameScreen.setPlayer(new Player(200, 300)); this.backgroundMusic = SoundSystem.playSound(this.config.backgroundMusic); + new LevelHeadline(100,100, this.config.name); } /** From a0788fc08d14e992d6d1644311a6de9e6f4b18e3 Mon Sep 17 00:00:00 2001 From: JJTCM Date: Tue, 9 Dec 2014 15:12:33 +0100 Subject: [PATCH 17/22] Changed the Test Level a bit EnemyFour can now be spawn with the Level Config EnemyFour now drops Items Removed simicolon from Keyboard Debugcode --- res/levels/test.level | 73 +++++++++++++++++-- .../spacescooter/control/Keyboard.java | 2 +- .../spacescooter/entity/enemy/EnemyFour.java | 14 +++- .../spacescooter/level/Level.java | 32 +++++--- .../spacescooter/level/LevelConfig.java | 14 ++-- .../spacescooter/level/LevelConfigParser.java | 19 ++++- 6 files changed, 127 insertions(+), 27 deletions(-) diff --git a/res/levels/test.level b/res/levels/test.level index 53bec45..13232da 100644 --- a/res/levels/test.level +++ b/res/levels/test.level @@ -4,19 +4,82 @@ background:CloudBackground nextLevel:levels/second.level - [0-1] -spawn:EnemyBoss,1,1,50 +spawn:EnemyTwo,1,4,5 +spawn:EnemyTwo,1,4,25 +spawn:EnemyTwo,1,4,45 +spawn:EnemyTwo,1,4,65 +spawn:EnemyTwo,1,4,85 +spawn:EnemyTwo,1,4,100 [1-2] +spawn:EnemyTwo,1,6,15 +spawn:EnemyTwo,1,6,35 +spawn:EnemyTwo,1,6,55 +spawn:EnemyTwo,1,6,75 +spawn:EnemyTwo,1,6,95 +[2-3] +spawn:EnemyTwo,1,4,5 +spawn:EnemyTwo,1,4,25 +spawn:EnemyTwo,1,4,45 +spawn:EnemyTwo,1,4,65 +spawn:EnemyTwo,1,4,85 +spawn:EnemyTwo,1,4,100 +[3-4] +spawn:EnemyTwo,1,6,15 +spawn:EnemyTwo,1,6,35 +spawn:EnemyTwo,1,6,55 +spawn:EnemyTwo,1,6,75 +spawn:EnemyTwo,1,6,95 +[4-5] +spawn:EnemyTwo,1,4,5 +spawn:EnemyTwo,1,4,25 +spawn:EnemyTwo,1,4,45 +spawn:EnemyTwo,1,4,65 +spawn:EnemyTwo,1,4,85 +spawn:EnemyTwo,1,4,100 +[5-6] +spawn:EnemyTwo,1,6,15 +spawn:EnemyTwo,1,6,35 +spawn:EnemyTwo,1,6,55 +spawn:EnemyTwo,1,6,75 +spawn:EnemyTwo,1,6,95 +[6-7] +spawn:EnemyTwo,1,4,5 +spawn:EnemyTwo,1,4,25 +spawn:EnemyTwo,1,4,45 +spawn:EnemyTwo,1,4,65 +spawn:EnemyTwo,1,4,85 +spawn:EnemyTwo,1,4,100 +[7-8] +spawn:EnemyTwo,1,6,15 +spawn:EnemyTwo,1,6,35 +spawn:EnemyTwo,1,6,55 +spawn:EnemyTwo,1,6,75 +spawn:EnemyTwo,1,6,95 +[8-9] +spawn:EnemyTwo,1,4,5 +spawn:EnemyTwo,1,4,25 +spawn:EnemyTwo,1,4,45 +spawn:EnemyTwo,1,4,65 +spawn:EnemyTwo,1,4,85 +spawn:EnemyTwo,1,4,100 +[9-10] +spawn:EnemyTwo,1,6,15 +spawn:EnemyTwo,1,6,35 +spawn:EnemyTwo,1,6,55 +spawn:EnemyTwo,1,6,75 +spawn:EnemyTwo,1,6,95 +[10-12] spawn:StoneOne,2,1,0 spawn:StoneOne,2,1,80 spawn:StoneThree,2,1,90 spawn:StoneThree,2,1,100 -[2-4] +[12-14] spawn:EnemyOne,1,5,20 spawn:StoneOne,4,5,50 -[4-10] +[14-20] spawn:EnemyTwo,1,10,60 -[10-25] +[20-35] spawn:EnemyThree,2,4,33 spawn:EnemyTwo,5,6,10 -[25-30] +[35-40] spawn:EnemyBoss,1,1,50 diff --git a/src/de/teamteamteam/spacescooter/control/Keyboard.java b/src/de/teamteamteam/spacescooter/control/Keyboard.java index dcb3bc2..0b507ad 100644 --- a/src/de/teamteamteam/spacescooter/control/Keyboard.java +++ b/src/de/teamteamteam/spacescooter/control/Keyboard.java @@ -117,7 +117,7 @@ public class Keyboard implements KeyListener { } if(e.getKeyCode() == KeyEvent.VK_4) { ArrayList points = new ArrayList(); - points.add(new Point(398,306));; + points.add(new Point(398,306)); points.add(new Point(10,300)); new EnemyFour(700,51,points); } diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java index 36aa40c..42826f2 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyFour.java @@ -4,6 +4,8 @@ import java.awt.Point; import java.util.ArrayList; import de.teamteamteam.spacescooter.entity.explosion.ExplosionOne; +import de.teamteamteam.spacescooter.entity.item.Item; +import de.teamteamteam.spacescooter.utility.Random; public class EnemyFour extends Enemy{ @@ -21,7 +23,8 @@ public class EnemyFour extends Enemy{ this.setImage("images/enemy01.png"); this.setPrimaryShotImage("images/shots/laser_yellow.png"); this.setShootSpeed(4); - this.setShootDelay(62); + this.setShootDelay(60); + this.setCanShoot(false); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setCollisionDamage(5); @@ -70,4 +73,13 @@ public class EnemyFour extends Enemy{ new ExplosionOne(this.getCenteredX(), this.getCenteredY()); } + /** + * This enemy spawns an Item on its death and causes another enemy to appear. + */ + @Override + public void die() { + if(Random.nextInt(100) < 5) Item.create(getX(), getY()); + super.die(); + } + } diff --git a/src/de/teamteamteam/spacescooter/level/Level.java b/src/de/teamteamteam/spacescooter/level/Level.java index e952002..b8c34f7 100644 --- a/src/de/teamteamteam/spacescooter/level/Level.java +++ b/src/de/teamteamteam/spacescooter/level/Level.java @@ -1,5 +1,8 @@ package de.teamteamteam.spacescooter.level; +import java.awt.Point; +import java.util.ArrayList; + import de.teamteamteam.spacescooter.background.CloudBackground; import de.teamteamteam.spacescooter.background.EarthBackground; import de.teamteamteam.spacescooter.background.StarBackground; @@ -10,6 +13,7 @@ import de.teamteamteam.spacescooter.entity.Entity; import de.teamteamteam.spacescooter.entity.Player; import de.teamteamteam.spacescooter.entity.enemy.Enemy; import de.teamteamteam.spacescooter.entity.enemy.EnemyBoss; +import de.teamteamteam.spacescooter.entity.enemy.EnemyFour; import de.teamteamteam.spacescooter.entity.enemy.EnemyOne; import de.teamteamteam.spacescooter.entity.enemy.EnemyThree; import de.teamteamteam.spacescooter.entity.enemy.EnemyTwo; @@ -88,7 +92,7 @@ public final class Level { * show the level name in a LevelHeadline. */ public void doBuildUp() { - this.spawnEntityByAvailableName(Entity.availableNames.valueOf(this.config.background), 0, 50); + this.spawnEntityByAvailableName(Entity.availableNames.valueOf(this.config.background), 0, 50, null); GameScreen.setPlayer(new Player(200, 300)); this.backgroundMusic = SoundSystem.playSound(this.config.backgroundMusic); new LevelHeadline(100,100, this.config.name); @@ -119,21 +123,30 @@ public final class Level { * - 2: Amount - The amount of Entities to spawn at a time. * - 3: SpawnRate - The rate at which the Entities are supposed to be spawned. * - 4: SpawnPosition - percentage of GameConfig.windowHeight - Where the Enemy shall spawn. + * - 5: Points - points for EnemyFour */ - for(int[] spawnRule : this.config.spawnRuleList) { + for(String[] spawnRule : this.config.spawnRuleList) { //Skip spawn rules that are not in the current spawn interval. - if(spawnRule[0] != currentIntervalIndex) continue; + if(Integer.parseInt(spawnRule[0]) != currentIntervalIndex) continue; //Divide the current interval by spawnrate - int intervalModulus = intervalLength / spawnRule[3]; + int intervalModulus = intervalLength / Integer.parseInt(spawnRule[3]); //Check whether the spawn rate strikes right now. if(relativeTimeWithinCurrentInterval % Math.max(1,intervalModulus) == 0) { //If the rule matches the current time, spawn the configured Entity in the configured amount: - for(int i=0; i points = null; //Minus one because the upper border is _excluded_ from the range! int x = GameConfig.gameScreenWidth + GameConfig.gameScreenXOffset - 1; + if (!spawnRule[5].equals("")) { + points = new ArrayList(); + String [] lol = spawnRule[5].split(";"); + for(int run = 0; run < lol.length; run = run+2) { + points.add(new Point(Integer.parseInt(lol[run]),Integer.parseInt(lol[run+1]))); + } + } //Minus one because the upper border is _excluded_ from the range! - int y = Math.round((GameConfig.gameScreenHeight * spawnRule[4]) / 100) + GameConfig.gameScreenYOffset - 1; - this.spawnEntityByAvailableName(Entity.availableNames.values()[spawnRule[1]], x, y); + int y = Math.round((GameConfig.gameScreenHeight * Integer.parseInt(spawnRule[4])) / 100) + GameConfig.gameScreenYOffset - 1; + this.spawnEntityByAvailableName(Entity.availableNames.values()[Integer.parseInt(spawnRule[1])], x, y, points); } } } @@ -210,7 +223,7 @@ public final class Level { * Spawn an Entity by name on the given position. * Uses Entity.availableNames to determine the actual Entity to spawn. */ - private void spawnEntityByAvailableName(Entity.availableNames entity, int x, int y) { + private void spawnEntityByAvailableName(Entity.availableNames entity, int x, int y, ArrayList points) { switch(entity) { case StarBackground: new StarBackground(x, y); @@ -231,7 +244,7 @@ public final class Level { new EnemyThree(x, y); break; case EnemyFour: - //TODO: FIX CONSTRUCTOR new EnemyFour(x, y); + new EnemyFour(x, y, points); break; case EnemyBoss: new EnemyBoss(x, y); @@ -250,5 +263,4 @@ public final class Level { break; } } - } diff --git a/src/de/teamteamteam/spacescooter/level/LevelConfig.java b/src/de/teamteamteam/spacescooter/level/LevelConfig.java index 72181a8..915641f 100644 --- a/src/de/teamteamteam/spacescooter/level/LevelConfig.java +++ b/src/de/teamteamteam/spacescooter/level/LevelConfig.java @@ -50,12 +50,12 @@ public class LevelConfig { * - 3: SpawnRate - The rate at which the Entities are supposed to be spawned. * - 4: SpawnPosition - percentage of GameConfig.windowHeight - Where the Enemy shall spawn. */ - public List spawnRuleList; + public List spawnRuleList; public LevelConfig() { this.intervalList = new ArrayList(); - this.spawnRuleList = new ArrayList(); + this.spawnRuleList = new ArrayList(); } public String toString() { @@ -70,7 +70,7 @@ public class LevelConfig { sb.append(" nextLevelName="); sb.append(this.nextLevel); sb.append("\\\n\tRules:\n"); - for(int[] rule : this.spawnRuleList) { + for(String[] rule : this.spawnRuleList) { sb.append("\t"); sb.append(rule); sb.append("\n"); @@ -126,17 +126,19 @@ public class LevelConfig { /** * Add a given EntitySpawnRule to the ruleList. + * @param wayPoints + * @param enemyWayPoints */ - public void addEntitySpawnRule(int intervalStart, int intervalEnd, String entityName, int amount, int spawnRate, int spawnPositionPercentage) { + public void addEntitySpawnRule(int intervalStart, int intervalEnd, String entityName, String amount, String spawnRate, String spawnPositionPercentage, String wayPoints) { int intervalIndex = this.getIntervalIndexByBorders(intervalStart, intervalEnd); if(intervalIndex == -1) { throw new LevelConfigException("No Interval for rule found!\nRule: " + intervalStart + " to " + intervalEnd + ": " + entityName + ", " + amount + ", " + spawnRate + ", " + spawnPositionPercentage); } else { int enemyNumber = Entity.availableNames.valueOf(entityName).ordinal(); - if(spawnPositionPercentage < 0 || spawnPositionPercentage > 100) { + if(Integer.parseInt(spawnPositionPercentage) < 0 || Integer.parseInt(spawnPositionPercentage) > 100) { throw new LevelConfigException("Invalid spawnPosition percentage!\nRule: " + intervalStart + " to " + intervalEnd + ": " + entityName + ", " + amount + ", " + spawnRate + ", " + spawnPositionPercentage); } - int[] newRule = {intervalIndex, enemyNumber, amount, spawnRate, spawnPositionPercentage}; + String[] newRule = {""+intervalIndex, ""+enemyNumber, ""+amount, ""+spawnRate, ""+spawnPositionPercentage, wayPoints}; this.spawnRuleList.add(newRule); } } diff --git a/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java b/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java index 84727a0..96714bb 100644 --- a/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java +++ b/src/de/teamteamteam/spacescooter/level/LevelConfigParser.java @@ -31,6 +31,11 @@ public class LevelConfigParser { */ private int currentIntervalStart; + /** + * The start of the last read interval. + */ + private String wayPoints; + /** * The end of the last read interval. */ @@ -88,14 +93,20 @@ public class LevelConfigParser { } else { String[] rule = line.split(":", 2); if(rule[0].equals("spawn")) { - String[] entitySpawnRule = rule[1].split(",", 4); + String[] entitySpawnRule = rule[1].split(",", 5); + if (entitySpawnRule.length <= 4) { + wayPoints = ""; + } else { + wayPoints = entitySpawnRule[4]; + } this.levelConfig.addEntitySpawnRule( this.currentIntervalStart, this.currentIntervalEnd, entitySpawnRule[0], - Integer.parseInt(entitySpawnRule[1]), - Integer.parseInt(entitySpawnRule[2]), - Integer.parseInt(entitySpawnRule[3]) + entitySpawnRule[1], + entitySpawnRule[2], + entitySpawnRule[3], + wayPoints ); } else { throw new LevelConfigException("Unknown rule type: '"+rule[0]+"' : '"+line+"'"); From 061569a237e0fa29d2ae47d1fb0a6d7391a90753 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 15:24:23 +0100 Subject: [PATCH 18/22] ja --- res/images/items/itemShotPowerUp.png | Bin 0 -> 1363 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 res/images/items/itemShotPowerUp.png diff --git a/res/images/items/itemShotPowerUp.png b/res/images/items/itemShotPowerUp.png new file mode 100644 index 0000000000000000000000000000000000000000..ccd20b9d0228b381dcf0d1ce436f22937136a8a1 GIT binary patch literal 1363 zcmV-Z1+4msP)Px#24YJ`L;%kKVE|#_rZlVo000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^<` z4H+=$8Gn-i000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000E8Nkl%UUo zTm&k)5hWvKETd9LFa(4IF(g_U8{GID!>zcD_ z1z_)nFO)a+7lc`?H#ZTovF2P8gi+Q5uyxHj-P09JZ2VmAT6giy-ij)~(T7G_k@cBt z-?9Aaa_2-eWWL|*g{N#$0Q)w6rif8x02ot`z6`*niFVQQ4$ z_HR0-C}A>!L6i!*OB3+Ks&)V_O*n|c1xu%uF}QkOa~IcH7l4{H5hM5=sy@yC^?(rx z<{=z_XzFsi0lc^QsMH9fs^PBdD{gXS=?YFQd9f9MZGWDibG?tA8+}QzLYH7g1!ga< zvrZ0$XaYIogSo3BV%fDm9=mpnF&!@=6Xo$;rFbvmlyspY5Vgz?WNCj1!!QKqo+)7% zEH*-^9{V?h@|$|iqR%(=p{W;LSDHAGLY4Fzz&?ETP-1@Cu6YGX)yhfJJC(X!8X^5J zAV_MM=A(P6xnInRDWijd$weayWFlaIh=_&W1r`Dv`2L$#9C&{CRr;^4B$^1S_j9ip zAzei$AY>qsm@i_Agka)>({6Z<$yNXcPmBXFvi6-4Spk6zC7Y%MASUCMNSN;~3-KJ2 zY+-dP0CP+-$avy}pExG+1p)}7866{n^$;XCYniR2IT&QTy$2XCWOK#`Oq56nfDj#L zd30RKpe$lCu)yBoZQNLTi@}-kRseQvA7RP$2ND$nQOT&uJ)N%G4i6oaWK^P?*;zC) z>(z(`dWeFYw5le<)vXmiM^^#Uw9`qHz|3%Bs>mlwo-v$8&LL0)bAFVQrIY&O>rQ4P zU`RQ-Am%zkBD^`f+k#PxhGmgx2#+$Th@(_PkaDt7Q8`z*T9{ny^8Q)4A}7vob}2SR zdI(gOP~~%&xYfHr6=44(Z?)pUOMlF;^7noxbJhSe=b1$+S)GnUfJzMkQtgp_tCHbe zms5A zk2Q;skc$Z#9}{)qR`&&%=*eVDK#j=ZbHmoEGa8-UV?oUdr&+w#;uFjXmc0>@Q00m! znE2@I4!f`B^w8iz)%l^jA=Mp?YOVE?XI{C#=JamQfh`|io|AHA?^h002ovPDHLkV1m$|X@LL$ literal 0 HcmV?d00001 From 6568fdd46af3f5dcac16782fb28c07de4a1b97a4 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 9 Dec 2014 15:29:38 +0100 Subject: [PATCH 19/22] balancing --- src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java index 67323bd..15c92a3 100644 --- a/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java +++ b/src/de/teamteamteam/spacescooter/entity/enemy/EnemyTwo.java @@ -9,7 +9,7 @@ public class EnemyTwo extends Enemy{ this.setImage("images/enemy02.png"); this.setPrimaryShotImage("images/shots/laser_green.png"); this.setShootSpeed(4); - this.setShootDelay(62); + this.setShootDelay(120); this.setShootSpawn(-10, 10); this.setShootDamage(5); this.setCollisionDamage(5); From 571d990f91bb9e400c1a32c93d4ab407876e67d8 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 15:30:40 +0100 Subject: [PATCH 20/22] Screens kommen jetzt in der korrekten Reihenfolge beim Spielen. --- src/de/teamteamteam/spacescooter/screen/GameScreen.java | 7 ++++--- src/de/teamteamteam/spacescooter/screen/GameWonScreen.java | 4 ++-- .../teamteamteam/spacescooter/screen/HighscoreScreen.java | 2 ++ src/de/teamteamteam/spacescooter/screen/LoadingScreen.java | 1 - src/de/teamteamteam/spacescooter/screen/ShopScreen.java | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/screen/GameScreen.java b/src/de/teamteamteam/spacescooter/screen/GameScreen.java index 9584ac6..06a214b 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameScreen.java @@ -94,10 +94,11 @@ public class GameScreen extends Screen { if (this.level.isGameOver()) { if(this.level.playerHasWon()) { if(PlayerSession.getNextLevel() == null) { - System.out.println("You beat the game! TODO: Transition to HighscoreScreen now!"); + this.parent.setOverlay(new HighscoreScreen(this.parent)); + } else { + //Go to the I don't know yet Screen if the game is over and the player WON. + this.parent.setOverlay(new GameWonScreen(this.parent)); } - //Go to the I don't know yet Screen if the game is over and the player WON. - this.parent.setOverlay(new GameWonScreen(this.parent)); } else { //Go to GameOverScreen if the game is over - the player died and lost the game. this.parent.setOverlay(new GameOverScreen(this.parent)); diff --git a/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java index f243742..58801bb 100644 --- a/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/GameWonScreen.java @@ -48,7 +48,7 @@ public class GameWonScreen extends Screen { g.drawString("You win!", GameConfig.windowWidth/2-210, 200); g.setFont(new Font("Monospace", 0, 20)); g.setColor(new Color(0, 0, 0)); - g.drawString("Forwards Ever!", GameConfig.windowWidth/2-70, 332); + g.drawString("Weiter", GameConfig.windowWidth/2-70, 332); g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-60, 432); } @@ -88,7 +88,7 @@ public class GameWonScreen extends Screen { } else if(this.animationStatus == 2) { switch (this.menuPoint) { case 0: - this.parent.setOverlay(new GameScreen(this.parent)); + this.parent.setOverlay(new ShopScreen(this.parent)); break; case 1: this.parent.setOverlay(new MainMenuScreen(this.parent)); diff --git a/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java b/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java index bdf57a4..e6deee2 100644 --- a/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/HighscoreScreen.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import java.util.Scanner; import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.brain.PlayerSession; import de.teamteamteam.spacescooter.control.Keyboard; import de.teamteamteam.spacescooter.entity.Player; import de.teamteamteam.spacescooter.gui.Button; @@ -62,6 +63,7 @@ public class HighscoreScreen extends Screen{ this.playerMoveSpeed += 0.1; } else this.animationStatus = 2; } else if(this.animationStatus == 2) { + PlayerSession.reset(); //The player now entered his highscore, reset the PlayerSession now. this.parent.setOverlay(new MainMenuScreen(this.parent)); } } diff --git a/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java b/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java index d0f1a47..d1944d4 100644 --- a/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java @@ -74,7 +74,6 @@ public class LoadingScreen extends Screen { g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight); g.setColor(Color.WHITE); g.setFont(new Font("Monospace", 0, 50)); - g.drawString("Loading ...", 100, 100); g.drawString("Progress: " + this.getProgress() + "%", 200, 500); } diff --git a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java index 6bc9d03..da9f772 100644 --- a/src/de/teamteamteam/spacescooter/screen/ShopScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/ShopScreen.java @@ -65,7 +65,7 @@ public class ShopScreen extends Screen { g.drawString("Rocket", GameConfig.windowWidth / 2 - 110, 390); g.drawString("Beam", GameConfig.windowWidth / 2 + 45, 390); g.setColor(new Color(0, 0, 0)); - g.drawString("Hauptmen\u00fc", GameConfig.windowWidth/2-55, 533); + g.drawString("Weiter", GameConfig.windowWidth/2-55, 533); } @Override @@ -154,7 +154,7 @@ public class ShopScreen extends Screen { this.playerMoveSpeed += 0.1; } else this.animationStatus = 2; } else if(this.animationStatus == 2) { - this.parent.setOverlay(new MainMenuScreen(this.parent)); + this.parent.setOverlay(new GameScreen(this.parent)); } } From f08d5ef6f5c950ecd2e1fcb2390f565dff6c54b4 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 15:43:24 +0100 Subject: [PATCH 21/22] LoadingScreen now much cooler 8-) --- .../spacescooter/screen/LoadingScreen.java | 13 ++++++++++++- .../teamteamteam/spacescooter/utility/Loader.java | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java b/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java index d1944d4..bbc1858 100644 --- a/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/LoadingScreen.java @@ -74,7 +74,18 @@ public class LoadingScreen extends Screen { g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight); g.setColor(Color.WHITE); g.setFont(new Font("Monospace", 0, 50)); - g.drawString("Progress: " + this.getProgress() + "%", 200, 500); + String text = "Loading ..."; + g.drawString(text, (GameConfig.windowWidth - g.getFontMetrics().stringWidth(text))/2, 150); + text = this.getProgress() + "%"; + g.drawString(text, (GameConfig.windowWidth - g.getFontMetrics().stringWidth(text))/2, GameConfig.windowHeight - 175); + int height = 75; + int width = GameConfig.windowWidth - 100; + int x = (GameConfig.windowWidth - width) / 2; + int y = GameConfig.windowHeight - 150; + int padding = 5; + g.drawRect(x - padding , y - padding, width + 2*padding, height + 2*padding); + g.setColor(Color.YELLOW); + g.fillRect(x, y, (int) (width * (this.getProgress() / 100.0)), height); } /** diff --git a/src/de/teamteamteam/spacescooter/utility/Loader.java b/src/de/teamteamteam/spacescooter/utility/Loader.java index 8d4b93b..81c676b 100644 --- a/src/de/teamteamteam/spacescooter/utility/Loader.java +++ b/src/de/teamteamteam/spacescooter/utility/Loader.java @@ -135,6 +135,12 @@ public class Loader { Loader.addLevelByFilename(e); } loadingScreen.increaseCurrentProcessed(); + //For the retro :D + try { + Thread.sleep(Random.nextInt(15)); + } catch (InterruptedException e1) { + e1.printStackTrace(); + } } } From 52152eccc15c05e1994e5cf43bf5e09023cd256f Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 9 Dec 2014 16:07:59 +0100 Subject: [PATCH 22/22] Add CreditsScreen Template. --- .../datastructure/ConcurrentLinkedList.java | 2 +- .../spacescooter/screen/CreditsScreen.java | 47 +++++++++++++++++++ .../spacescooter/screen/MainMenuScreen.java | 1 + .../spacescooter/screen/Screen.java | 2 + 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/de/teamteamteam/spacescooter/screen/CreditsScreen.java diff --git a/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java b/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java index 9a8b721..1ec4b9e 100644 --- a/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java +++ b/src/de/teamteamteam/spacescooter/datastructure/ConcurrentLinkedList.java @@ -47,7 +47,7 @@ public class ConcurrentLinkedList { while(element.equals(currentNode.getValue()) == false && currentNode.hasNext()) { currentNode = currentNode.next(); } - if(currentNode.getValue().equals(element)) { + if(currentNode.getValue() != null && currentNode.getValue().equals(element)) { currentNode.setValue(null); return; } diff --git a/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java b/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java new file mode 100644 index 0000000..64fa6de --- /dev/null +++ b/src/de/teamteamteam/spacescooter/screen/CreditsScreen.java @@ -0,0 +1,47 @@ +package de.teamteamteam.spacescooter.screen; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.event.KeyEvent; + +import de.teamteamteam.spacescooter.brain.GameConfig; +import de.teamteamteam.spacescooter.control.Keyboard; +import de.teamteamteam.spacescooter.entity.enemy.EnemyOne; + +/** + * This is the Screen where you can look at all those awesome guys who created this game. :D + */ +public class CreditsScreen extends Screen { + + /** + * Default Constructor + */ + public CreditsScreen(Screen parent) { + super(parent); + } + + /** + * Draw the Credits :) + */ + @Override + protected void paint(Graphics2D g) { + g.setColor(new Color(0,0,120)); + g.fillRect(0, 0, GameConfig.windowWidth, GameConfig.windowHeight); + g.setColor(Color.WHITE); + g.setFont(new Font("Monospace", 0, 50)); + String text = "#yolo"; + g.drawString(text, (GameConfig.windowWidth - g.getFontMetrics().stringWidth(text))/2, 150); + } + + /** + * In case the Loader is done, immediately fire up the MainMenuScreen. + */ + @Override + protected void update() { + if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) || Keyboard.isKeyDown(KeyEvent.VK_SPACE)) { + this.parent.setOverlay(new MainMenuScreen(this.parent)); + } + } + +} diff --git a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java index 31c5394..bac1066 100644 --- a/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java +++ b/src/de/teamteamteam/spacescooter/screen/MainMenuScreen.java @@ -108,6 +108,7 @@ public class MainMenuScreen extends Screen { this.parent.setOverlay(new HighscoreScreen(this.parent)); break; case 3: + this.parent.setOverlay(new CreditsScreen(this.parent)); break; case 4: System.exit(0); diff --git a/src/de/teamteamteam/spacescooter/screen/Screen.java b/src/de/teamteamteam/spacescooter/screen/Screen.java index 09fb977..8f351ec 100644 --- a/src/de/teamteamteam/spacescooter/screen/Screen.java +++ b/src/de/teamteamteam/spacescooter/screen/Screen.java @@ -241,6 +241,8 @@ public abstract class Screen { if(this.processSetOverlayCall) { if(this.overlay != null) { this.overlay.cleanup(); + } else { + this.cleanup(); } if(this.newOverlay == null) { Screen.currentScreen = this;