|
Before Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 694 B After Width: | Height: | Size: 694 B |
|
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 747 B |
|
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 946 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,39 @@
|
||||
package com.dungeoncrawler.model.entities;
|
||||
|
||||
import com.dungeoncrawler.StaticMath;
|
||||
import com.dungeoncrawler.model.Entity;
|
||||
|
||||
public class Iceswordsman extends Entity {
|
||||
|
||||
public Iceswordsman(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 = 15;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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.model.entities;
|
||||
|
||||
import com.dungeoncrawler.StaticMath;
|
||||
import com.dungeoncrawler.model.Entity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jonathan
|
||||
*/
|
||||
public class Icewizard extends Entity{
|
||||
|
||||
int counter;
|
||||
final int minRange;
|
||||
final int maxRange;
|
||||
final int attackSpeed;
|
||||
|
||||
public Icewizard(float xPos, float yPos, int lvl) {
|
||||
super(xPos, yPos, lvl);
|
||||
|
||||
this.maxhp = 80*lvl;
|
||||
this.hp = this.maxhp;
|
||||
this.direction = 1;
|
||||
this.dmg = 12*lvl;
|
||||
this.id = 16;
|
||||
this.type = 1;
|
||||
minRange = 64;
|
||||
maxRange = 124;
|
||||
attackSpeed = 60;
|
||||
counter = 0;
|
||||
// TODO: Sinnvolle Werte finden
|
||||
|
||||
direction = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean move(int xPosPlayer, int yPosPlayer) {
|
||||
if(!isToDelete()){
|
||||
|
||||
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer + 32, yPosPlayer + 32);
|
||||
int distance = (int) StaticMath.calculateDistance((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer, alpha);
|
||||
|
||||
if(distance >= minRange && distance <= maxRange && counter % attackSpeed == 0){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
movementX = (int) (3 * Math.cos(alpha));
|
||||
movementY = (int) (3 * Math.sin(alpha));
|
||||
|
||||
if(distance < minRange){
|
||||
movementX *= -1;
|
||||
movementY *= -1;
|
||||
}
|
||||
else if(distance >= minRange && distance <= maxRange){
|
||||
movementX = 0;
|
||||
movementY = 0;
|
||||
}
|
||||
|
||||
|
||||
xPos += movementX;
|
||||
yPos += movementY;
|
||||
}
|
||||
|
||||
if(alpha >= Math.PI / -2 && alpha <= Math.PI / 2){
|
||||
setDirection(1);
|
||||
}
|
||||
else{
|
||||
setDirection(0);
|
||||
}
|
||||
|
||||
counter++;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity shoot(int xPosPlayer, int yPosPlayer){
|
||||
Spell a = null;
|
||||
|
||||
if(!isToDelete()){
|
||||
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer + 32, yPosPlayer + 32);
|
||||
|
||||
a = new Spell(this.xPos + 32, this.yPos + 32, this.lvl,(int) this.dmg, 17, true);
|
||||
int tempX = (int) (5 * Math.cos(alpha));
|
||||
int tempY = (int) (5 * Math.sin(alpha));
|
||||
|
||||
a.setMovementX(tempX);
|
||||
a.setMovementY(tempY);
|
||||
a.setAngle(alpha);
|
||||
|
||||
if((alpha >= 0 && alpha <= Math.PI / 2) || (alpha <= 2 * Math.PI && alpha >= 2 * Math.PI - Math.PI / 2)){
|
||||
setDirection(1);
|
||||
}
|
||||
else{
|
||||
setDirection(0);
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
}
|
||||