Item hinzugefügt

master
Jonathan Hager 6 years ago
parent 8a8064d4b0
commit 3ed33526d4

@ -10,6 +10,11 @@ public abstract class Entity {
protected int dmg; protected int dmg;
protected int lvl; protected int lvl;
public Entity(int xPos, int yPos, int lvl){
this.xPos = xPos;
this.yPos = yPos;
this.lvl = lvl;
}
public void attack(){ public void attack(){

@ -0,0 +1,35 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.dungeoncrawler;
/**
*
* @author jonathan
*/
public abstract class Item {
private int amount;
public Item(int amount){
this.amount = amount;
}
/**
* @return the amount
*/
public int getAmount() {
return amount;
}
/**
* @param amount the amount to set
*/
public void setAmount(int amount) {
this.amount = amount;
}
}

@ -3,8 +3,15 @@ import com.dungeoncrawler.Entity;
public class Archer extends Entity{ public class Archer extends Entity{
public Archer(int ebene, int x, int y){ public Archer(int xPos, int yPos, int lvl) {
this.hp = 10; super(xPos, yPos, lvl);
this.maxhp = 5*lvl;
this.hp = this.maxhp;
this.dmg = 3*lvl;
// TODO: Sinnvolle Werte finden
} }
} }

@ -5,10 +5,23 @@
*/ */
package com.dungeoncrawler.entities; package com.dungeoncrawler.entities;
import com.dungeoncrawler.Entity;
/** /**
* *
* @author Jan * @author Jan
*/ */
public class Player { public class Player extends Entity {
public Player(int xPos, int yPos, int lvl) {
super(xPos, yPos, lvl);
this.maxhp = 5*lvl;
this.hp = this.maxhp;
this.dmg = 3*lvl;
// TODO: Sinnvolle Werte finden
}
} }

@ -5,10 +5,23 @@
*/ */
package com.dungeoncrawler.entities; package com.dungeoncrawler.entities;
import com.dungeoncrawler.Entity;
/** /**
* *
* @author Jan * @author Jan
*/ */
public class Swordsman { public class Swordsman extends Entity {
public Swordsman(int xPos, int yPos, int lvl) {
super(xPos, yPos, lvl);
this.maxhp = 5*lvl;
this.hp = this.maxhp;
this.dmg = 3*lvl;
// TODO: Sinnvolle Werte finden
}
} }

@ -0,0 +1,20 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.dungeoncrawler.items;
import com.dungeoncrawler.Item;
/**
*
* @author jonathan
*/
public class Key extends Item {
public Key(int amount) {
super(amount);
}
}

@ -0,0 +1,20 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.dungeoncrawler.items;
import com.dungeoncrawler.Item;
/**
*
* @author jonathan
*/
public class Potion extends Item {
public Potion(int amount) {
super(amount);
}
}

@ -0,0 +1,20 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.dungeoncrawler.items;
import com.dungeoncrawler.Item;
/**
*
* @author jonathan
*/
public class Sword extends Item {
public Sword(int amount) {
super(amount);
}
}

@ -5,8 +5,8 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.dungeoncrawler.Main; import com.dungeoncrawler.Main;
public class DesktopLauncher { public class DesktopLauncher {
public static void main (String[] arg) { public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new Main(), config); new LwjglApplication(new Main(), config);
} }
} }

Loading…
Cancel
Save