import processing.core.PApplet; import java.util.ArrayList; import java.util.List; /** * This is the main player of the game we can move around with and interact. */ public class Player extends Fightable implements Health { int x, y; int health; int maxHealth = 20; List skills = new ArrayList(); Player(Fenster window) { super(window); this.type = "@"; this.x = 4; this.y = 4; this.health = maxHealth; this.skills.add(new Tritt(window, this)); } public void damage(int damage) { health = health - damage; if (health <= 0) { window.println("dead"); } } public void heal(int healing) { health = health + healing; if (health > maxHealth) { health = maxHealth; } } }