diff --git a/res/images/items/itemCredit.png b/res/images/items/itemCredit.png new file mode 100644 index 0000000..780135e Binary files /dev/null and b/res/images/items/itemCredit.png differ diff --git a/res/images/items/itemHeal.png b/res/images/items/itemHeal.png new file mode 100644 index 0000000..2d12ab2 Binary files /dev/null and b/res/images/items/itemHeal.png differ diff --git a/res/images/items/itemNuke.png b/res/images/items/itemNuke.png new file mode 100644 index 0000000..125f528 Binary files /dev/null and b/res/images/items/itemNuke.png differ diff --git a/res/images/items/itemShield.png b/res/images/items/itemShield.png new file mode 100644 index 0000000..2f200a5 Binary files /dev/null and b/res/images/items/itemShield.png differ diff --git a/src/de/teamteamteam/spacescooter/entity/item/Item.java b/src/de/teamteamteam/spacescooter/entity/item/Item.java index 25342e0..8854bdc 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/Item.java +++ b/src/de/teamteamteam/spacescooter/entity/item/Item.java @@ -48,16 +48,16 @@ public abstract class Item extends CollidableEntity { int auswahl = ItemChance.choose(); switch (auswahl) { case 0: - new TestItem5(x, y); + new ItemNuke(x, y); break; case 1: - new TestItem2(x, y); + new ItemCredit(x, y); break; case 2: - new TestItem3(x, y); + new ItemHeal(x, y); break; case 3: - new TestItem4(x, y); + new ItemShield(x, y); break; case 4: new TestItem1(x, y); diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemCredit.java b/src/de/teamteamteam/spacescooter/entity/item/ItemCredit.java new file mode 100644 index 0000000..b429f2d --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemCredit.java @@ -0,0 +1,18 @@ +package de.teamteamteam.spacescooter.entity.item; + +import de.teamteamteam.spacescooter.entity.Player; + +public class ItemCredit extends Item { + + public static int chance = 2; + + public ItemCredit(int x, int y) { + super(x, y); + this.setImage("images/items/itemCredit.png"); + } + + @Override + public void itemCollected(Player player) { + player.setShootDamage(player.getShootDamage()+5); + } +} diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java b/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java new file mode 100644 index 0000000..12c33d0 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java @@ -0,0 +1,18 @@ +package de.teamteamteam.spacescooter.entity.item; + +import de.teamteamteam.spacescooter.entity.Player; + +public class ItemHeal extends Item { + + public static int chance = 3; + + public ItemHeal(int x, int y) { + super(x, y); + this.setImage("images/items/itemHeal.png"); + } + + @Override + public void itemCollected(Player player) { + player.increaseHealthPoints(15); + } +} diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemNuke.java b/src/de/teamteamteam/spacescooter/entity/item/ItemNuke.java new file mode 100644 index 0000000..42d5746 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemNuke.java @@ -0,0 +1,19 @@ +package de.teamteamteam.spacescooter.entity.item; + +import de.teamteamteam.spacescooter.entity.Player; + +public class ItemNuke extends Item { + +public static int chance = 2; + + public ItemNuke(int x, int y) { + super(x, y); + this.setImage("images/items/itemNuke.png"); + } + + @Override + public void itemCollected(Player player) { + System.out.println("Gotta Nuke 'em All!"); + } + +} diff --git a/src/de/teamteamteam/spacescooter/entity/item/ItemShield.java b/src/de/teamteamteam/spacescooter/entity/item/ItemShield.java new file mode 100644 index 0000000..9cb7153 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/item/ItemShield.java @@ -0,0 +1,18 @@ +package de.teamteamteam.spacescooter.entity.item; + +import de.teamteamteam.spacescooter.entity.Player; + +public class ItemShield extends Item { + + public static int chance = 4; + + public ItemShield(int x, int y) { + super(x, y); + this.setImage("images/items/itemShield.png"); + } + + @Override + public void itemCollected(Player player) { + player.setShieldPoints(player.getShieldPoints() + 5); + } +}