diff --git a/core/assets/sprites/arrow.png b/core/assets/sprites/arrow.png index 0ef5436..7df0703 100644 Binary files a/core/assets/sprites/arrow.png and b/core/assets/sprites/arrow.png differ diff --git a/core/assets/sprites/doorleft.png b/core/assets/sprites/doorleft.png index 21217e7..53a02d5 100644 Binary files a/core/assets/sprites/doorleft.png and b/core/assets/sprites/doorleft.png differ diff --git a/core/assets/sprites/doorright.png b/core/assets/sprites/doorright.png index f5c806d..d296cff 100644 Binary files a/core/assets/sprites/doorright.png and b/core/assets/sprites/doorright.png differ diff --git a/core/assets/sprites/icearcher.png b/core/assets/sprites/icearcher.png new file mode 100644 index 0000000..431b8cd Binary files /dev/null and b/core/assets/sprites/icearcher.png differ diff --git a/core/assets/sprites/icearrow.png b/core/assets/sprites/icearrow.png new file mode 100644 index 0000000..c370296 Binary files /dev/null and b/core/assets/sprites/icearrow.png differ diff --git a/core/src/com/dungeoncrawler/model/DungeonGenerator.java b/core/src/com/dungeoncrawler/model/DungeonGenerator.java index d00f159..447e844 100644 --- a/core/src/com/dungeoncrawler/model/DungeonGenerator.java +++ b/core/src/com/dungeoncrawler/model/DungeonGenerator.java @@ -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; } diff --git a/core/src/com/dungeoncrawler/model/entities/Archer.java b/core/src/com/dungeoncrawler/model/entities/Archer.java index eb699f0..b169d3a 100644 --- a/core/src/com/dungeoncrawler/model/entities/Archer.java +++ b/core/src/com/dungeoncrawler/model/entities/Archer.java @@ -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 diff --git a/core/src/com/dungeoncrawler/model/entities/Earthwizard.java b/core/src/com/dungeoncrawler/model/entities/Earthwizard.java index 1631e2d..34a0980 100644 --- a/core/src/com/dungeoncrawler/model/entities/Earthwizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Earthwizard.java @@ -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 diff --git a/core/src/com/dungeoncrawler/model/entities/Firewizard.java b/core/src/com/dungeoncrawler/model/entities/Firewizard.java index 903269b..2e4e0d7 100644 --- a/core/src/com/dungeoncrawler/model/entities/Firewizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Firewizard.java @@ -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; diff --git a/core/src/com/dungeoncrawler/model/entities/Icearcher.java b/core/src/com/dungeoncrawler/model/entities/Icearcher.java new file mode 100644 index 0000000..af5461f --- /dev/null +++ b/core/src/com/dungeoncrawler/model/entities/Icearcher.java @@ -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; + } + +} diff --git a/core/src/com/dungeoncrawler/model/entities/Player.java b/core/src/com/dungeoncrawler/model/entities/Player.java index 794569c..e598dcd 100644 --- a/core/src/com/dungeoncrawler/model/entities/Player.java +++ b/core/src/com/dungeoncrawler/model/entities/Player.java @@ -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(); } diff --git a/core/src/com/dungeoncrawler/model/items/Amulet.java b/core/src/com/dungeoncrawler/model/items/Amulet.java index 39f0c4c..b2f31c1 100644 --- a/core/src/com/dungeoncrawler/model/items/Amulet.java +++ b/core/src/com/dungeoncrawler/model/items/Amulet.java @@ -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; } diff --git a/core/src/com/dungeoncrawler/view/GameScreen.java b/core/src/com/dungeoncrawler/view/GameScreen.java index 54f03d5..110dbd0 100644 --- a/core/src/com/dungeoncrawler/view/GameScreen.java +++ b/core/src/com/dungeoncrawler/view/GameScreen.java @@ -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); diff --git a/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java b/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java index 6c5d2a3..2281534 100644 --- a/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java +++ b/desktop/src/com/dungeoncrawler/desktop/DesktopLauncher.java @@ -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 {