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

@ -12,43 +12,81 @@ public class PlayerDrawer extends AbstractDrawer implements Drawer {
@Override
public void draw() throws IOException {
//TODO Pictures for different facing directions.
switch(player.name){
if (player.hasBox()) {
switch (player.name) {
case "O'Neill":
switch(player.facingDirection){
case NORTH:
changeImage("ONeill.png");
switch (player.facingDirection) {
case NORTH:
changeImage("ONeill_Up_Box.png");
break;
case EAST:
changeImage("ONeill_east.png");
changeImage("ONeill_Right_Box.png");
break;
case SOUTH:
changeImage("ONeill.png");
changeImage("ONeill_Down_Box.png");
break;
default:
changeImage("ONeill_west.png");
changeImage("ONeill_Left_Box.png");
break;
}
break;
default:
switch(player.facingDirection){
case NORTH:
changeImage("Jaffa.png");
switch (player.facingDirection) {
case NORTH:
changeImage("Jaffa_Up_Box.png");
break;
case EAST:
changeImage("Jaffa_east.png");
changeImage("Jaffa_Right_Box.png");
break;
case SOUTH:
changeImage("Jaffa.png");
changeImage("Jaffa_Down_Box.png");
break;
default:
changeImage("Jaffa_west.png");
changeImage("Jaffa_Left_Box.png");
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