Closes #13. Boxes are now purrfectly stackable.
This commit is contained in:
parent
230f36d856
commit
378f26fdff
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user