master
GammelJan 6 years ago
parent 13bfb22665
commit 67a91e3996

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

@ -308,26 +308,26 @@ public class DungeonGenerator {
Entity temp;
int id = (int) (Math.random() * 5);
int id = (int) (Math.random() * 6);
switch(id){
case 0:
temp = new Archer(xPos, yPos, lvl);
break;
case 1:
temp = new Swordsman(xPos, yPos, lvl);
break;
case 2:
temp = new Wizard(xPos, yPos, lvl);
break;
case 3:
temp = new Firewizard(xPos, yPos, lvl);
break;
case 4:
temp = new Earthwizard(xPos, yPos, lvl);
break;
case 5:
temp = new Fireswordsman(xPos, yPos, lvl);
break;
default:
temp = null;
}

@ -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;
}
}

@ -363,6 +363,10 @@ public class GameScreen {
tx[0] = new Texture("sprites/earthspell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 10:
tx[0] = new Texture("sprites/fireswordsman.png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
}
entitySprites[i].update((int) e.getxPos() + 32, (int) e.getyPos() + 32);

Loading…
Cancel
Save