Closes #13. Boxes are now purrfectly stackable.

This commit is contained in:
Kjistóf 2016-05-14 19:47:29 +02:00
parent 230f36d856
commit 378f26fdff
4 changed files with 17 additions and 1 deletions

View File

@ -12,6 +12,12 @@ public class Gate extends Tile {
if (this.open) adjacentTile.get(direction).spawnStargate(stargate, direction); if (this.open) adjacentTile.get(direction).spawnStargate(stargate, direction);
} }
@Override
public boolean boxPermission()
{
return open;
}
@Override @Override
public void onEntry(PlayerBase playerBase) { public void onEntry(PlayerBase playerBase) {
super.onEntry(playerBase); super.onEntry(playerBase);

View File

@ -32,7 +32,7 @@ public class Player extends PlayerBase {
public void boxDrop() { public void boxDrop() {
if(!isDestroyed()) { if(!isDestroyed()) {
Tile target = currentTile.getAdjacentTile(facingDirection); Tile target = currentTile.getAdjacentTile(facingDirection);
if (target.isSteppable()) { if (target.boxPermission()) {
target.putABox(boxLifted); target.putABox(boxLifted);
boxLifted = null; boxLifted = null;
} }

View File

@ -93,4 +93,8 @@ public abstract class Tile {
public boolean hasBox() { public boolean hasBox() {
return !boxStack.isEmpty(); return !boxStack.isEmpty();
} }
public boolean boxPermission() {
return true;
}
} }

View File

@ -30,6 +30,12 @@ public class Wall extends Tile {
} }
} }
@Override
public boolean boxPermission()
{
return false;
}
@Override @Override
public void onEntry(PlayerBase playerBase) { public void onEntry(PlayerBase playerBase) {
super.onEntry(playerBase); super.onEntry(playerBase);