Added specified Items, updated some ItemsCollected-Methods

This commit is contained in:
Licht 2014-11-18 13:41:21 +01:00
parent 1759efd694
commit 4ea4eea6cf
9 changed files with 77 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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!");
}
}

View File

@ -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);
}
}