diff --git a/res/images/shopTest01.png b/res/images/shopTest01.png new file mode 100644 index 0000000..964d920 Binary files /dev/null and b/res/images/shopTest01.png differ diff --git a/res/images/shopTest02.png b/res/images/shopTest02.png new file mode 100644 index 0000000..a548428 Binary files /dev/null and b/res/images/shopTest02.png differ diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index 3c060a0..d7290bf 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -18,14 +18,14 @@ public class Player extends ShootingEntity implements KeyboardListener { super(x, y); this.setImage("images/ship.png"); this.setPrimaryShotImage("images/shots/laser_blue.png"); - this.setShootDamage(PlayerStatus.ShootDamage); + this.setShootDamage(StaticValue.ShootDamage); this.setShootDelay(20); this.setShootSpawn(50, 16); this.setShootDirection(Shot.RIGHT); this.setShootSpeed(10); this.setCollisionDamage(10); - this.setShieldPoints(100); - this.setHealthPoints(PlayerStatus.HealthPoints); + this.setShieldPoints(StaticValue.ShieldPoints); + this.setHealthPoints(StaticValue.HealthPoints); this.registerOnKeyboard(Keyboard.getInstance()); } diff --git a/src/de/teamteamteam/spacescooter/entity/PlayerStatus.java b/src/de/teamteamteam/spacescooter/entity/PlayerStatus.java deleted file mode 100644 index 5b2dcef..0000000 --- a/src/de/teamteamteam/spacescooter/entity/PlayerStatus.java +++ /dev/null @@ -1,11 +0,0 @@ -package de.teamteamteam.spacescooter.entity; - -public class PlayerStatus { - - /** - * Status values for the player - */ - - public static int ShootDamage = 5; - public static int HealthPoints = 100; -} diff --git a/src/de/teamteamteam/spacescooter/entity/StaticValue.java b/src/de/teamteamteam/spacescooter/entity/StaticValue.java new file mode 100644 index 0000000..dde2b4c --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/StaticValue.java @@ -0,0 +1,18 @@ +package de.teamteamteam.spacescooter.entity; + +public class StaticValue { + + /** + * Values for the player + */ + public static int ShootDamage = 5; + public static int HealthPoints = 100; + public static int ShieldPoints = 100; + + /** + * Values for the Shop + */ + public static int schaden = 0; + public static int schild = 0; + public static int leben = 0; +} diff --git a/src/de/teamteamteam/spacescooter/gui/Credits.java b/src/de/teamteamteam/spacescooter/gui/Credits.java index 930a580..b1ebeb0 100644 --- a/src/de/teamteamteam/spacescooter/gui/Credits.java +++ b/src/de/teamteamteam/spacescooter/gui/Credits.java @@ -12,6 +12,5 @@ public class Credits { public static void setCredits(int credits) { Credits.credits = credits; - System.out.println(credits); } } diff --git a/src/de/teamteamteam/spacescooter/gui/ShopOffer.java b/src/de/teamteamteam/spacescooter/gui/ShopOffer.java new file mode 100644 index 0000000..d05aa77 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/gui/ShopOffer.java @@ -0,0 +1,51 @@ +package de.teamteamteam.spacescooter.gui; + +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; + +import de.teamteamteam.spacescooter.entity.Entity; + +public class ShopOffer extends Entity{ + + private String offer; + private int gekauft; + private int max; + + public ShopOffer(int x, int y, int max, int gekauft, String offer) { + super(x, y); + this.offer = offer; + this.gekauft = gekauft; + this.max = max; + for (int i = 0; i0) { this.menuPoint--; - this.player.setPosition(this.player.getX(), 259+(this.menuPoint*100)); + this.player.setPosition(50, this.player.getY()); + this.player.setPosition(this.player.getX(), 159+(this.menuPoint*100)); } }else if(Keyboard.isKeyDown(KeyEvent.VK_ENTER) && !this.keyPressed && this.animationStatus == 0) { this.keyPressed = true; + /////////////////////////////////////////////////////////////// switch (this.menuPoint) { case 0: - if(Credits.getCredits() >= 5){ - PlayerStatus.ShootDamage += 5; + if(Credits.getCredits() >= 5 && schaden.getGekauft() < schaden.getMax()){ + schaden.buy(); + StaticValue.ShootDamage += 5; + StaticValue.schaden++; Credits.setCredits(Credits.getCredits() - 5); + System.out.println(schaden.getGekauft()); } break; case 1: - if(Credits.getCredits() >= 10){ - PlayerStatus.HealthPoints += 10; + if(Credits.getCredits() >= 10 && schild.getGekauft() < schild.getMax()){ + schild.buy(); + StaticValue.ShieldPoints += 10; + StaticValue.schild++; Credits.setCredits(Credits.getCredits() - 10); } break; case 2: + if(Credits.getCredits() >= 10 && leben.getGekauft() < leben.getMax()){ + leben.buy(); + StaticValue.HealthPoints += 10; + StaticValue.leben++; + Credits.setCredits(Credits.getCredits() - 10); + } + break; + case 3: this.animationStatus = 1; break; }