Added specified Items, updated some ItemsCollected-Methods
This commit is contained in:
parent
1759efd694
commit
4ea4eea6cf
BIN
res/images/items/itemCredit.png
Normal file
BIN
res/images/items/itemCredit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 832 B |
BIN
res/images/items/itemHeal.png
Normal file
BIN
res/images/items/itemHeal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
res/images/items/itemNuke.png
Normal file
BIN
res/images/items/itemNuke.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
res/images/items/itemShield.png
Normal file
BIN
res/images/items/itemShield.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
@ -48,16 +48,16 @@ public abstract class Item extends CollidableEntity {
|
|||||||
int auswahl = ItemChance.choose();
|
int auswahl = ItemChance.choose();
|
||||||
switch (auswahl) {
|
switch (auswahl) {
|
||||||
case 0:
|
case 0:
|
||||||
new TestItem5(x, y);
|
new ItemNuke(x, y);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
new TestItem2(x, y);
|
new ItemCredit(x, y);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
new TestItem3(x, y);
|
new ItemHeal(x, y);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
new TestItem4(x, y);
|
new ItemShield(x, y);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
new TestItem1(x, y);
|
new TestItem1(x, y);
|
||||||
|
18
src/de/teamteamteam/spacescooter/entity/item/ItemCredit.java
Normal file
18
src/de/teamteamteam/spacescooter/entity/item/ItemCredit.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
18
src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java
Normal file
18
src/de/teamteamteam/spacescooter/entity/item/ItemHeal.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
19
src/de/teamteamteam/spacescooter/entity/item/ItemNuke.java
Normal file
19
src/de/teamteamteam/spacescooter/entity/item/ItemNuke.java
Normal 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!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
18
src/de/teamteamteam/spacescooter/entity/item/ItemShield.java
Normal file
18
src/de/teamteamteam/spacescooter/entity/item/ItemShield.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user