Closes #13. Boxes are now purrfectly stackable.
This commit is contained in:
		| @@ -12,6 +12,12 @@ public class Gate extends Tile { | ||||
|         if (this.open) adjacentTile.get(direction).spawnStargate(stargate, direction); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean boxPermission() | ||||
|     { | ||||
|         return open; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onEntry(PlayerBase playerBase) { | ||||
|         super.onEntry(playerBase); | ||||
|   | ||||
| @@ -32,7 +32,7 @@ public class Player extends PlayerBase { | ||||
|     public void boxDrop() { | ||||
|         if(!isDestroyed()) { | ||||
|             Tile target = currentTile.getAdjacentTile(facingDirection); | ||||
|             if (target.isSteppable()) { | ||||
|             if (target.boxPermission()) { | ||||
|                 target.putABox(boxLifted); | ||||
|                 boxLifted = null; | ||||
|             } | ||||
|   | ||||
| @@ -93,4 +93,8 @@ public abstract class Tile { | ||||
|     public boolean hasBox() { | ||||
|         return !boxStack.isEmpty(); | ||||
|     } | ||||
|  | ||||
|     public boolean boxPermission() { | ||||
|         return true; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -30,6 +30,12 @@ public class Wall extends Tile { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean boxPermission() | ||||
|     { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onEntry(PlayerBase playerBase) { | ||||
|         super.onEntry(playerBase); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user