master
GammelJan 6 years ago
parent 31da4cb5bd
commit a1a2053437

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

@ -309,7 +309,7 @@ public class DungeonGenerator {
Entity temp;
int id = (int) (Math.random() * 6);
int id = (int) (Math.random() * 7);
switch(id){
case 0:
temp = new Archer(xPos, yPos, lvl);
@ -329,6 +329,9 @@ public class DungeonGenerator {
case 5:
temp = new Fireswordsman(xPos, yPos, lvl);
break;
case 6:
temp = new Icearcher(xPos, yPos, lvl);
break;
default:
temp = null;
}

@ -19,9 +19,9 @@ public class Archer extends Entity{
this.dmg = 7*lvl;
this.id = 0;
this.type = 1;
minRange = 164;
minRange = 64;
maxRange = 184;
attackSpeed = 60;
attackSpeed = 30;
counter = 0;
// TODO: Sinnvolle Werte finden

@ -28,9 +28,9 @@ public class Earthwizard extends Entity{
this.dmg = 12*lvl;
this.id = 8;
this.type = 1;
minRange = 84;
minRange = 64;
maxRange = 104;
attackSpeed = 80;
attackSpeed = 50;
counter = 0;
// TODO: Sinnvolle Werte finden

@ -28,7 +28,7 @@ public class Firewizard extends Entity{
this.dmg = 12*lvl;
this.id = 6;
this.type = 1;
minRange = 104;
minRange = 64;
maxRange = 124;
attackSpeed = 60;
counter = 0;

@ -0,0 +1,99 @@
package com.dungeoncrawler.model.entities;
import com.dungeoncrawler.StaticMath;
import com.dungeoncrawler.model.Entity;
public class Icearcher extends Entity{
int counter;
final int minRange;
final int maxRange;
final int attackSpeed;
public Icearcher(float xPos, float yPos, int lvl) {
super(xPos, yPos, lvl);
this.maxhp = 100*lvl;
this.hp = this.maxhp;
this.direction = 1;
this.dmg = 12*lvl;
this.id = 11;
this.type = 1;
minRange = 64;
maxRange = 184;
attackSpeed = 50;
counter = 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);
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) (4 * Math.cos(alpha));
movementY = (int) (4 * 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){
Projectile a = null;
if(!isToDelete()){
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
a = new Projectile(this.xPos + 32, this.yPos + 32, this.lvl,(int) this.dmg, 12, true);
int tempX = (int) (6 * Math.cos(alpha));
int tempY = (int) (6 * 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;
}
}

@ -27,7 +27,7 @@ public class Player extends Entity {
this.hp = this.maxhp;
this.standartMaxHp = 100 * lvl;
this.dmg = 60*lvl;
this.dmg = 20*lvl;
this.standartDmg = this.dmg;
id = -1;
type = -1;
@ -40,7 +40,7 @@ public class Player extends Entity {
public void updateStats(int ey){
lvl = ey;
standartMaxHp = 100 * ey;
standartDmg = 100 * ey;
standartDmg = 20 * ey;
updateItems();
}

@ -15,8 +15,8 @@ public class Amulet extends Item {
public Amulet(int lvl) {
super(lvl);
this.dmg = 25 * (lvl + 1);
this.heal = 0 * (lvl + 1);
this.dmg = 25 * lvl;
this.heal = 0 * lvl;
this.id = 2;
}

@ -334,7 +334,7 @@ public class GameScreen {
case 2:
tx[0] = new Texture("sprites/arrow.png");
entitySprites[i] = new EntitySprite(tx, 24, 12);
entitySprites[i] = new EntitySprite(tx, 24, 5);
break;
case 3:
@ -373,6 +373,14 @@ public class GameScreen {
tx[0] = new Texture("sprites/fireswordsman.png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 11:
tx[0] = new Texture("sprites/icearcher.png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 12:
tx[0] = new Texture("sprites/icearrow.png");
entitySprites[i] = new EntitySprite(tx, 24, 5);
break;
}
entitySprites[i].update((int) e.getxPos() + 32, (int) e.getyPos() + 32);

@ -2,7 +2,8 @@ package com.dungeoncrawler.desktop;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicati
onConfiguration;
import com.dungeoncrawler.control.Controller;
public class DesktopLauncher {

Loading…
Cancel
Save