summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7646ac0)
raw | patch | inline | side by side (parent: 7646ac0)
author | fred-boy <fredboy@protonmail.com> | |
Fri, 27 Sep 2019 13:18:40 +0000 (20:18 +0700) | ||
committer | fred-boy <fredboy@protonmail.com> | |
Sun, 29 Sep 2019 04:39:17 +0000 (11:39 +0700) |
core/src/ru/deadsoftware/cavedroid/game/GameWorld.java | patch | blob | history |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameWorld.java b/core/src/ru/deadsoftware/cavedroid/game/GameWorld.java
index e9539e207b8d5701c307fc7623a1117ef06c061d..9c71cfc306a32ff9aa92dd3b8d318dd3096f9803 100644 (file)
}
}
- public boolean hasBlockAt(int x, int y) {
+ public boolean hasForeAt(int x, int y) {
return getMap(x, y, 0) != 0;
}
+ public boolean hasBackAt(int x, int y) {
+ return getMap(x, y, 1) != 0;
+ }
+
public int getForeMap(int x, int y) {
return getMap(x, y, 0);
}
}
public void placeToForeground(int x, int y, int value) {
- if (!hasBlockAt(x, y) || value == 0 || !GameItems.getBlock(getForeMap(x, y)).hasCollision()) {
+ if (!hasForeAt(x, y) || value == 0 || !GameItems.getBlock(getForeMap(x, y)).hasCollision()) {
setForeMap(x, y, value);
} else if (GameItems.isSlab(value) && getForeMap(x, y) == value) {
placeSlab(x, y, value);