Implemented initial player death

This commit is contained in:
Bokros Bálint
2016-05-13 22:10:29 +02:00
parent 7f98954211
commit 1974396f61
4 changed files with 30 additions and 17 deletions

View File

@ -31,16 +31,16 @@ public class PlayerBase implements Destroyable {
}
public void move(Direction direction) {
this.setFacingDirection(direction);
Tile adjtile = this.getCurrentTile().getAdjacentTile(direction);
if(!isDestroyed()) {
this.setFacingDirection(direction);
Tile adjtile = this.getCurrentTile().getAdjacentTile(direction);
if (adjtile != null)
{
if (adjtile.isSteppable())
{
currentTile.onExit(this);
setCurrentTile(adjtile);
adjtile.onEntry(this);
if (adjtile != null) {
if (adjtile.isSteppable()) {
currentTile.onExit(this);
setCurrentTile(adjtile);
adjtile.onEntry(this);
}
}
}
}