parent
13bfb22665
commit
67a91e3996
|
After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,39 @@
|
||||
package com.dungeoncrawler.model.entities;
|
||||
|
||||
import com.dungeoncrawler.StaticMath;
|
||||
import com.dungeoncrawler.model.Entity;
|
||||
|
||||
public class Fireswordsman extends Entity {
|
||||
|
||||
public Fireswordsman(float xPos, float yPos, int lvl) {
|
||||
super(xPos, yPos, lvl);
|
||||
|
||||
this.maxhp = 130*lvl;
|
||||
this.hp = this.maxhp;
|
||||
this.direction = 1;
|
||||
this.dmg = 20*lvl;
|
||||
this.id = 10;
|
||||
this.type = 0;
|
||||
|
||||
// TODO: Sinnvolle Werte finden
|
||||
direction = 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean move(int xPosPlayer, int yPosPlayer){
|
||||
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));
|
||||
|
||||
xPos += movementX;
|
||||
yPos += movementY;
|
||||
|
||||
updateDirection();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue