master
GammelJan 6 years ago
parent c01ad1c845
commit 72e45148a1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@ -73,8 +73,10 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
@Override
public void create(){
checkDoor = true;
checkDoor = false;
checkDie = true;
end = false;
playerSkin = 0;

@ -309,7 +309,7 @@ public class DungeonGenerator {
Entity temp;
int id = (int) (Math.random() * 8);
int id = (int) (Math.random() * 10);
switch(id){
case 0:
temp = new Archer(xPos, yPos, lvl);
@ -335,6 +335,12 @@ public class DungeonGenerator {
case 7:
temp = new Firearcher(xPos, yPos, lvl);
break;
case 8:
temp = new Iceswordsman(xPos, yPos, lvl);
break;
case 9:
temp = new Icewizard(xPos, yPos, lvl);
break;
default:
temp = null;
}

@ -28,8 +28,8 @@ public class Earthwizard extends Entity{
this.dmg = 12*lvl;
this.id = 8;
this.type = 1;
minRange = 64;
maxRange = 104;
minRange = 84;
maxRange = 144;
attackSpeed = 50;
counter = 0;
// TODO: Sinnvolle Werte finden
@ -41,7 +41,7 @@ public class Earthwizard extends Entity{
public boolean move(int xPosPlayer, int yPosPlayer) {
if(!isToDelete()){
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
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){
@ -86,8 +86,8 @@ public class Earthwizard extends Entity{
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
a = new Spell(this.xPos + 32, this.yPos + 32, this.lvl,(int) this.dmg, 9, true);
int tempX = (int) (6 * Math.cos(alpha));
int tempY = (int) (6 * Math.sin(alpha));
int tempX = (int) (5 * Math.cos(alpha));
int tempY = (int) (5 * Math.sin(alpha));
a.setMovementX(tempX);
a.setMovementY(tempY);

@ -41,7 +41,7 @@ public class Firewizard extends Entity{
public boolean move(int xPosPlayer, int yPosPlayer) {
if(!isToDelete()){
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
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){
@ -83,11 +83,11 @@ public class Firewizard extends Entity{
Spell a = null;
if(!isToDelete()){
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
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, 7, true);
int tempX = (int) (6 * Math.cos(alpha));
int tempY = (int) (6 * Math.sin(alpha));
int tempX = (int) (5 * Math.cos(alpha));
int tempY = (int) (5 * Math.sin(alpha));
a.setMovementX(tempX);
a.setMovementY(tempY);

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

@ -39,6 +39,8 @@ public class Player extends Entity {
public void updateStats(int ey){
lvl = ey;
//hp = 100*ey * (hp/(100*(ey-1)));
//maxhp = 100 * ey;
standartMaxHp = 100 * ey;
standartDmg = 20 * ey;
updateItems();

@ -41,7 +41,7 @@ public class Wizard extends Entity{
public boolean move(int xPosPlayer, int yPosPlayer) {
if(!isToDelete()){
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
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){
@ -86,8 +86,8 @@ public class Wizard extends Entity{
double alpha = StaticMath.calculateAngle((int) this.xPos, (int) this.yPos, xPosPlayer, yPosPlayer);
a = new Spell(this.xPos + 32, this.yPos + 32, this.lvl,(int) this.dmg, 4, true);
int tempX = (int) (6 * Math.cos(alpha));
int tempY = (int) (6 * Math.sin(alpha));
int tempX = (int) (5 * Math.cos(alpha));
int tempY = (int) (5 * Math.sin(alpha));
a.setMovementX(tempX);
a.setMovementY(tempY);

@ -77,46 +77,46 @@ public class GameScreen {
Texture[] playerTexture = new Texture[4];
switch(d.getPlayer().getSkin()){
case 0:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/player.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/player.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/player.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/player.png"));
break;
case 1:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playerblue.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playerblue.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playerblue.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playerblue.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerblue.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerblue.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerblue.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerblue.png"));
break;
case 2:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playerpurple.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playerpurple.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playerpurple.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playerpurple.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerpurple.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerpurple.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerpurple.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerpurple.png"));
break;
case 3:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playergreen.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playergreen.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playergreen.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playergreen.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playergreen.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playergreen.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playergreen.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playergreen.png"));
break;
case 4:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playerorange.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playerorange.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playerorange.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playerorange.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerorange.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerorange.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerorange.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerorange.png"));
break;
case 5:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playerblack.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playerblack.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playerblack.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playerblack.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerblack.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerblack.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerblack.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerblack.png"));
break;
case 6:
playerTexture[0] = new Texture(Gdx.files.internal("sprites/playerred.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/playerred.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/playerred.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/playerred.png"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerred.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerred.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerred.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerred.png"));
break;
}
@ -319,74 +319,95 @@ public class GameScreen {
Texture[] tx = new Texture[1];
//nimmt entity ID -> 0 = Archer || 1 = Swordsman || 2 = Arrow || 3 = Wizard
double g = Math.random();
String gender;
if(g >= 0.5){
gender = "m";
}
else{
gender = "w";
}
switch(e.getId()){
case 0:
tx[0] = new Texture("sprites/archer.png");
tx[0] = new Texture("sprites/archer/archer_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 1:
tx[0] = new Texture("sprites/swordsman.png");
tx[0] = new Texture("sprites/swordsman/swordsman_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 2:
tx[0] = new Texture("sprites/arrow.png");
tx[0] = new Texture("sprites/projectile/arrow.png");
entitySprites[i] = new EntitySprite(tx, 24, 5);
break;
case 3:
tx[0] = new Texture("sprites/wizard.png");
tx[0] = new Texture("sprites/wizard/wizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 4:
tx[0] = new Texture("sprites/spell.png");
tx[0] = new Texture("sprites/spell/spell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 5:
tx[0] = new Texture("sprites/laser.png");
tx[0] = new Texture("sprites/projectile/laser.png");
entitySprites[i] = new EntitySprite(tx, 36, 15);
break;
case 6:
tx[0] = new Texture("sprites/firewizard.png");
tx[0] = new Texture("sprites/wizard/firewizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 7:
tx[0] = new Texture("sprites/firespell.png");
tx[0] = new Texture("sprites/spell/firespell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 8:
tx[0] = new Texture("sprites/earthwizard.png");
tx[0] = new Texture("sprites/wizard/earthwizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 9:
tx[0] = new Texture("sprites/earthspell.png");
tx[0] = new Texture("sprites/spell/earthspell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 10:
tx[0] = new Texture("sprites/fireswordsman.png");
tx[0] = new Texture("sprites/swordsman/fireswordsman_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 11:
tx[0] = new Texture("sprites/icearcher.png");
tx[0] = new Texture("sprites/archer/icearcher_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 12:
tx[0] = new Texture("sprites/icearrow.png");
tx[0] = new Texture("sprites/projectile/icearrow.png");
entitySprites[i] = new EntitySprite(tx, 24, 5);
break;
case 13:
tx[0] = new Texture("sprites/firearcher.png");
tx[0] = new Texture("sprites/archer/firearcher_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 14:
tx[0] = new Texture("sprites/firearrow.png");
tx[0] = new Texture("sprites/projectile/firearrow.png");
entitySprites[i] = new EntitySprite(tx, 24, 5);
break;
case 15:
tx[0] = new Texture("sprites/swordsman/iceswordsman_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 16:
tx[0] = new Texture("sprites/wizard/icewizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 17:
tx[0] = new Texture("sprites/spell/icespell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
}
entitySprites[i].update((int) e.getxPos() + 32, (int) e.getyPos() + 32);

@ -141,7 +141,7 @@ public class HudContainer {
}
selectedSprite.draw(batch);
playerHealthSprite.draw(batch);
font.draw(batch, p.getHp() + " / " + p.getMaxhp(), playerHealthSprite.getX()+18, playerHealthSprite.getY()+14);
if(items[selected] != null){
String selectedName = "";

@ -97,13 +97,13 @@ public class MainMenuScreen{
shownPlayer = 0;
animationState = 0;
playerRegion[0] = TextureRegion.split(new Texture("sprites/player.png"), 64, 64);
playerRegion[1] = TextureRegion.split(new Texture("sprites/playerblue.png"), 64, 64);
playerRegion[2] = TextureRegion.split(new Texture("sprites/playerpurple.png"), 64, 64);
playerRegion[3] = TextureRegion.split(new Texture("sprites/playergreen.png"), 64, 64);
playerRegion[4] = TextureRegion.split(new Texture("sprites/playerorange.png"), 64, 64);
playerRegion[5] = TextureRegion.split(new Texture("sprites/playerblack.png"), 64, 64);
playerRegion[6] = TextureRegion.split(new Texture("sprites/playerred.png"), 64, 64);
playerRegion[0] = TextureRegion.split(new Texture("sprites/player/player.png"), 64, 64);
playerRegion[1] = TextureRegion.split(new Texture("sprites/player/playerblue.png"), 64, 64);
playerRegion[2] = TextureRegion.split(new Texture("sprites/player/playerpurple.png"), 64, 64);
playerRegion[3] = TextureRegion.split(new Texture("sprites/player/playergreen.png"), 64, 64);
playerRegion[4] = TextureRegion.split(new Texture("sprites/player/playerorange.png"), 64, 64);
playerRegion[5] = TextureRegion.split(new Texture("sprites/player/playerblack.png"), 64, 64);
playerRegion[6] = TextureRegion.split(new Texture("sprites/player/playerred.png"), 64, 64);
playerSprite = new Sprite(playerRegion[shownPlayer][0][animationState]);

@ -18,4 +18,4 @@ public class DesktopLauncher {
new LwjglApplication(new Controller(), config);
}
}
//
//ss
Loading…
Cancel
Save