added method Tile.isSteppable() for obvious reasons...

This commit is contained in:
2016-05-13 17:59:14 +02:00
parent 39a442ba14
commit 06f4e32942
7 changed files with 48 additions and 4 deletions

View File

@ -32,12 +32,15 @@ public class PlayerBase implements Destroyable {
public void move(Direction direction) {
this.setFacingDirection(direction);
Tile tile = this.getCurrentTile().getAdjacentTile(direction);
Tile adjtile = this.getCurrentTile().getAdjacentTile(direction);
if (tile != null)
if (adjtile != null)
{
tile.onEntry(this);
setCurrentTile(tile);
if (adjtile.isSteppable())
{
adjtile.onEntry(this);
setCurrentTile(adjtile);
}
}
}