ICH WILL SPIELEN

master
GammelJan 6 years ago
parent ad8449cac6
commit 5637c70d6f

@ -42,22 +42,21 @@ public abstract class Entity {
public void rdmMove(float xPlayer, float yPlayer){ public void rdmMove(float xPlayer, float yPlayer){
if(xPlayer == xPos){ if(xPlayer == xPos){
if(yPlayer == yPos){} if(yPlayer == yPos){}
else if(yPlayer > yPos){movementY = 1f;} else if(yPlayer > yPos){movementY = -1f;}
else if(yPlayer < yPos){movementY = -1f;} else if(yPlayer < yPos){movementY = 1f;}
} }
else if(yPlayer == yPos){ else if(yPlayer == yPos){
if(xPlayer == xPos){} if(xPlayer == xPos){}
else if(xPlayer > xPos){movementX = -1f;} else if(xPlayer > xPos){movementX = 1f;}
else if(xPlayer < xPos){movementX = 1f;} else if(xPlayer < xPos){movementX = -1f;}
} }
/////
else if(xPlayer > xPos){ else if(xPlayer > xPos){
if(yPlayer > yPos){ //archer ist im Quadrant III if(yPlayer > yPos){ //archer ist im Quadrant III
if((yPos - yPlayer) > (xPos - xPlayer)){ if((yPos - yPlayer) > (xPos - xPlayer)){
movementX = 1f; movementY = 1f;
} }
else{ else{
movementY = 1f; movementX = 1f;
} }
} }
else if(yPlayer < yPos){ //archer ist im Quadrant IV else if(yPlayer < yPos){ //archer ist im Quadrant IV
@ -80,10 +79,10 @@ public abstract class Entity {
} }
else if(yPlayer > yPos){ //archer ist im Quadrant I else if(yPlayer > yPos){ //archer ist im Quadrant I
if((yPlayer - yPos) > (xPos - xPlayer)){ if((yPlayer - yPos) > (xPos - xPlayer)){
movementX = -1; movementY = -1;
} }
else{ else{
movementY = -1; movementX = -1;
} }
} }
} }
@ -114,16 +113,16 @@ public abstract class Entity {
} }
public int direction(){ public int direction(){
if(movementX < 0){ if(movementX < 0f){
return 3; return 3;
} }
else if(movementX < 3){ else if(movementX < 3f){
return 1; return 1;
} }
else if(movementY > 3){ else if(movementY > 3f){
return 0; return 0;
} }
else if(movementY < -3){ else if(movementY < -3f){
return 2; return 2;
} }
return -1; return -1;

@ -0,0 +1,17 @@
/*
* 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.view;
import com.dungeoncrawler.model.entities.Player;
/**
*
* @author Jan
*/
public class Hud {
public Hud(Player p){}
}
Loading…
Cancel
Save