PlayerDrawer now handles rotation.

PlayerDrawer is now sync'd with source images.
This commit is contained in:
ericnerdo 2016-05-13 15:15:43 +02:00
parent f38c4e5bd6
commit e64e18233c

View File

@ -13,43 +13,81 @@ public class PlayerDrawer extends AbstractDrawer implements Drawer {
@Override @Override
public void draw() throws IOException { public void draw() throws IOException {
//TODO Pictures for different facing directions. if (player.hasBox()) {
switch(player.name){ switch (player.name) {
case "O'Neill": case "O'Neill":
switch(player.facingDirection){ switch (player.facingDirection) {
case NORTH: case NORTH:
changeImage("ONeill.png"); changeImage("ONeill_Up_Box.png");
break; break;
case EAST: case EAST:
changeImage("ONeill_east.png"); changeImage("ONeill_Right_Box.png");
break; break;
case SOUTH: case SOUTH:
changeImage("ONeill.png"); changeImage("ONeill_Down_Box.png");
break; break;
default: default:
changeImage("ONeill_west.png"); changeImage("ONeill_Left_Box.png");
break; break;
} }
break; break;
default: default:
switch(player.facingDirection){ switch (player.facingDirection) {
case NORTH: case NORTH:
changeImage("Jaffa.png"); changeImage("Jaffa_Up_Box.png");
break; break;
case EAST: case EAST:
changeImage("Jaffa_east.png"); changeImage("Jaffa_Right_Box.png");
break; break;
case SOUTH: case SOUTH:
changeImage("Jaffa.png"); changeImage("Jaffa_Down_Box.png");
break; break;
default: default:
changeImage("Jaffa_west.png"); changeImage("Jaffa_Left_Box.png");
break; break;
} }
break; break;
} }
} }
else {
switch (player.name) {
case "O'Neill":
switch (player.facingDirection) {
case NORTH:
changeImage("ONeill_Up.png");
break;
case EAST:
changeImage("ONeill_Right.png");
break;
case SOUTH:
changeImage("ONeill_Down.png");
break;
default:
changeImage("ONeill_Left.png");
break;
}
break;
default:
switch (player.facingDirection) {
case NORTH:
changeImage("Jaffa_Up.png");
break;
case EAST:
changeImage("Jaffa_Right.png");
break;
case SOUTH:
changeImage("Jaffa_Down.png");
break;
default:
changeImage("Jaffa_Left.png");
break;
}
break;
}
}
}
@Override @Override
public int getTileX() { public int getTileX() {