Archer läuft nur nach rechts unten lol

master
GammelJan 6 years ago
parent 0a5928cf3c
commit f558d60fe7

@ -37,7 +37,18 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
@Override @Override
public void render(){ public void render(){
switch((int) (Math.random() * 5)){
case 0: //left
a.move(-3,0);
case 1: //right
a.move(3,0);
case 2: //up
a.move(0,3);
case 3: //down
a.move(0,-3);
}
v.render(batch, movementX ,movementY, a.getxPos(), a.getyPos()); v.render(batch, movementX ,movementY, a.getxPos(), a.getyPos());
} }
@Override @Override

@ -20,7 +20,7 @@ public abstract class Entity {
public void attack(){ public void attack(){
} }
public void update(){ public void update(){
@ -29,7 +29,8 @@ public abstract class Entity {
} }
public void move(int movementX, int movementY){ public void move(int movementX, int movementY){
xPos = xPos + movementX;
yPos = yPos + movementY;
} }

@ -16,4 +16,6 @@ public class Archer extends Entity{
} }

@ -24,4 +24,6 @@ public class Swordsman extends Entity {
// TODO: Sinnvolle Werte finden // TODO: Sinnvolle Werte finden
} }
} }

Loading…
Cancel
Save