PlayerBaseDrawer.java added.
This commit is contained in:
parent
25fd8189d2
commit
e63a62893e
49
cicaprojekt/PlayerBaseDrawer.java
Normal file
49
cicaprojekt/PlayerBaseDrawer.java
Normal file
@ -0,0 +1,49 @@
|
||||
package cicaprojekt;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PlayerBaseDrawer extends ImagePanel implements Drawer {
|
||||
PlayerBase playerbase;
|
||||
|
||||
public PlayerBaseDrawer(PlayerBase pb) throws IOException {
|
||||
super("Replicator.png");
|
||||
playerbase = pb;
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() throws IOException {
|
||||
|
||||
//TODO Pictures for different facing directions.
|
||||
switch(playerbase.name){
|
||||
case "Replicator":
|
||||
switch(playerbase.facingDirection){
|
||||
case NORTH:
|
||||
changeImage("ONeill.png");
|
||||
break;
|
||||
case EAST:
|
||||
changeImage("ONeill.png");
|
||||
break;
|
||||
case SOUTH:
|
||||
changeImage("ONeill.png");
|
||||
break;
|
||||
default:
|
||||
changeImage("ONeill.png");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileX() {
|
||||
return playerbase.currentTile.getX();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileY() {
|
||||
return playerbase.currentTile.getY();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user