master
GammelJan 6 years ago
parent 9b07112179
commit c1959c03c2

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@ -868,6 +868,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
case 6:
d.getPlayer().setSkin(mm.getSkin());
d.getPlayer().setGender(mm.getGender());
return true;

@ -309,7 +309,7 @@ public class DungeonGenerator {
Entity temp;
int id = (int) (Math.random() * 10);
int id = (int) (Math.random() * 12);
switch(id){
case 0:
temp = new Archer(xPos, yPos, lvl);
@ -341,6 +341,18 @@ public class DungeonGenerator {
case 9:
temp = new Icewizard(xPos, yPos, lvl);
break;
case 10:
temp = new Waterwizard(xPos, yPos, lvl);
break;
case 11:
//temp = new Healwizard(xPos, yPos, lvl);
/* wird nicht gespawnt
BUG: HP über 100%, also crash in HUD container lol
keine Lust zu beheben
--TODO--
*/
temp = null;
break;
default:
temp = null;
}

@ -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 Healwizard extends Entity{
int counter;
final int minRange;
final int maxRange;
final int attackSpeed;
public Healwizard(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 = 20;
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, 21, 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;
}
}

@ -19,10 +19,12 @@ public class Player extends Entity {
float standartMaxHp;
int skin;
String gender;
public Player() {
super(200, 200, 1);
this.skin = 0;
this.gender = "m";
this.maxhp = 100 * lvl;
this.hp = this.maxhp;
this.standartMaxHp = 100 * lvl;
@ -135,6 +137,12 @@ public class Player extends Entity {
public int getSkin(){
return skin;
}
public void setGender(String i){
gender = i;
}
public String getGender(){
return gender;
}
public boolean inventoryFull(){
return inv.inventoryFull();
}

@ -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 Waterwizard extends Entity{
int counter;
final int minRange;
final int maxRange;
final int attackSpeed;
public Waterwizard(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 = 18;
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, 19, 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;
}
}

@ -75,48 +75,49 @@ public class GameScreen {
//PLAYER
Texture[] playerTexture = new Texture[4];
String gender = d.getPlayer().getGender();
switch(d.getPlayer().getSkin()){
case 0:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/player_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/player_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/player_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/player_"+gender+".png"));
break;
case 1:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerblue_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerblue_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerblue_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerblue_"+gender+".png"));
break;
case 2:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerpurple_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerpurple_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerpurple_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerpurple_"+gender+".png"));
break;
case 3:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playergreen_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playergreen_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playergreen_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playergreen_"+gender+".png"));
break;
case 4:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerorange_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerorange_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerorange_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerorange_"+gender+".png"));
break;
case 5:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerblack_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerblack_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerblack_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerblack_"+gender+".png"));
break;
case 6:
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"));
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player/playerred_"+gender+".png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player/playerred_"+gender+".png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player/playerred_"+gender+".png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player/playerred_"+gender+".png"));
break;
}
@ -408,6 +409,22 @@ public class GameScreen {
tx[0] = new Texture("sprites/spell/icespell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 18:
tx[0] = new Texture("sprites/wizard/waterwizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 19:
tx[0] = new Texture("sprites/spell/waterspell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
case 20:
tx[0] = new Texture("sprites/wizard/healwizard_"+gender+".png");
entitySprites[i] = new EntitySprite(tx, 64, 64);
break;
case 21:
tx[0] = new Texture("sprites/spell/healspell.png");
entitySprites[i] = new EntitySprite(tx, 16, 16);
break;
}
entitySprites[i].update((int) e.getxPos() + 32, (int) e.getyPos() + 32);

@ -24,6 +24,8 @@ public class MainMenuScreen{
Sprite quitButtonSprite;
Sprite backgroundSprite;
Sprite settingsButtonSprite;
Sprite maleButton;
Sprite femaleButton;
boolean hidden;
@ -48,6 +50,8 @@ public class MainMenuScreen{
Sprite buttonRight;
Sprite buttonLeft;
String gender;
public MainMenuScreen(float volume) {
@ -56,17 +60,23 @@ public class MainMenuScreen{
h = Gdx.graphics.getHeight();
float wc = w/2;
gender = "m";
hidden = false;
Texture backgroundTexture = new Texture("sprites/MAINSCREEN.png");
Texture startButtonTexture = new Texture("sprites/startButton.png");
Texture quitButtonTexture = new Texture("sprites/quitButton.png");
Texture settingsButtonTexture = new Texture("sprites/settingsButton.png");
Texture maleButtonTexture = new Texture("sprites/male.png");
Texture femaleButtonTexture = new Texture("sprites/female.png");
backgroundSprite = new Sprite(backgroundTexture);
startButtonSprite = new Sprite(startButtonTexture);
quitButtonSprite = new Sprite(quitButtonTexture);
settingsButtonSprite = new Sprite(settingsButtonTexture);
maleButton = new Sprite(maleButtonTexture);
femaleButton = new Sprite(femaleButtonTexture);
backgroundSprite.setX(0);
backgroundSprite.setY(0);
@ -97,13 +107,13 @@ public class MainMenuScreen{
shownPlayer = 0;
animationState = 0;
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);
playerRegion[0] = TextureRegion.split(new Texture("sprites/player/player_"+gender+".png"), 64, 64);
playerRegion[1] = TextureRegion.split(new Texture("sprites/player/playerblue_"+gender+".png"), 64, 64);
playerRegion[2] = TextureRegion.split(new Texture("sprites/player/playerpurple_"+gender+".png"), 64, 64);
playerRegion[3] = TextureRegion.split(new Texture("sprites/player/playergreen_"+gender+".png"), 64, 64);
playerRegion[4] = TextureRegion.split(new Texture("sprites/player/playerorange_"+gender+".png"), 64, 64);
playerRegion[5] = TextureRegion.split(new Texture("sprites/player/playerblack_"+gender+".png"), 64, 64);
playerRegion[6] = TextureRegion.split(new Texture("sprites/player/playerred_"+gender+".png"), 64, 64);
playerSprite = new Sprite(playerRegion[shownPlayer][0][animationState]);
@ -116,6 +126,9 @@ public class MainMenuScreen{
buttonRight.setPosition(skinContainer.getX() + 106, skinContainer.getY()+25);
playerSprite.setPosition(skinContainer.getX() + 50, skinContainer.getY() + 15);
maleButton.setPosition(skinContainer.getX()+165, skinContainer.getY()+25);
femaleButton.setPosition(skinContainer.getX()+165, skinContainer.getY()+25);
preview = new Timer();
preview.scheduleTask(new Timer.Task() {
@Override
@ -153,7 +166,18 @@ public class MainMenuScreen{
skinContainer.draw(batch);
buttonLeft.draw(batch);
buttonRight.draw(batch);
playerSprite.draw(batch);
if(gender.equals("m")){
maleButton.draw(batch);
}
else{
femaleButton.draw(batch);
}
}
batch.end();
}
@ -187,11 +211,42 @@ public class MainMenuScreen{
}
return -1;
}
if(Intersector.overlaps(r, buttonLeft.getBoundingRectangle())){
if(shownPlayer > 0){
shownPlayer--;
return 6;
}
return -1;
}
if(Intersector.overlaps(r, maleButton.getBoundingRectangle())){
if(gender.equals("m")){
gender = "w";
updateGender();
return 6;
}
else{
gender = "m";
updateGender();
return 6;
}
}
}
return -1;
}
public void updateGender(){
playerRegion[0] = TextureRegion.split(new Texture("sprites/player/player_"+gender+".png"), 64, 64);
playerRegion[1] = TextureRegion.split(new Texture("sprites/player/playerblue_"+gender+".png"), 64, 64);
playerRegion[2] = TextureRegion.split(new Texture("sprites/player/playerpurple_"+gender+".png"), 64, 64);
playerRegion[3] = TextureRegion.split(new Texture("sprites/player/playergreen_"+gender+".png"), 64, 64);
playerRegion[4] = TextureRegion.split(new Texture("sprites/player/playerorange_"+gender+".png"), 64, 64);
playerRegion[5] = TextureRegion.split(new Texture("sprites/player/playerblack_"+gender+".png"), 64, 64);
playerRegion[6] = TextureRegion.split(new Texture("sprites/player/playerred_"+gender+".png"), 64, 64);
playerSprite = new Sprite(playerRegion[shownPlayer][0][animationState]);
playerSprite.setPosition(skinContainer.getX() + 50, skinContainer.getY() + 15);
}
public void cleanUp(){
music.dispose();
}
@ -211,6 +266,9 @@ public class MainMenuScreen{
public int getSkin(){
return shownPlayer;
}
public String getGender(){
return gender;
}
}

Loading…
Cancel
Save