|
|
|
|
@ -8,10 +8,10 @@ public class Swordsman extends Entity {
|
|
|
|
|
public Swordsman(float xPos, float yPos, int lvl) {
|
|
|
|
|
super(xPos, yPos, lvl);
|
|
|
|
|
|
|
|
|
|
this.maxhp = 100*lvl;
|
|
|
|
|
this.maxhp = 110*lvl;
|
|
|
|
|
this.hp = this.maxhp;
|
|
|
|
|
this.direction = 1;
|
|
|
|
|
this.dmg = 16*lvl;
|
|
|
|
|
this.dmg = 15*lvl;
|
|
|
|
|
this.id = 1;
|
|
|
|
|
this.type = 0;
|
|
|
|
|
|
|
|
|
|
@ -24,8 +24,8 @@ public class Swordsman extends Entity {
|
|
|
|
|
if(!isToDelete()){
|
|
|
|
|
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
|
|
|
|
|
|
|
|
|
|
movementX = (int) (3 * Math.cos(alpha));
|
|
|
|
|
movementY = (int) (3 * Math.sin(alpha));
|
|
|
|
|
movementX = (int) (4 * Math.cos(alpha));
|
|
|
|
|
movementY = (int) (4 * Math.sin(alpha));
|
|
|
|
|
|
|
|
|
|
xPos += movementX;
|
|
|
|
|
yPos += movementY;
|
|
|
|
|
|