summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a27390a)
raw | patch | inline | side by side (parent: a27390a)
author | fred-boy <fredboy@protonmail.com> | |
Fri, 27 Sep 2019 16:49:44 +0000 (23:49 +0700) | ||
committer | fred-boy <fredboy@protonmail.com> | |
Sun, 29 Sep 2019 04:39:17 +0000 (11:39 +0700) |
core/src/ru/deadsoftware/cavedroid/game/GameItems.java | patch | blob | history | |
core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java | patch | blob | history | |
core/src/ru/deadsoftware/cavedroid/misc/ControlMode.java | [new file with mode: 0644] | patch | blob |
core/src/ru/deadsoftware/cavedroid/misc/states/AppState.java | [moved from core/src/ru/deadsoftware/cavedroid/misc/AppState.java with 100% similarity] | patch | blob | history |
core/src/ru/deadsoftware/cavedroid/misc/states/GameState.java | [new file with mode: 0644] | patch | blob |
core/src/ru/deadsoftware/cavedroid/misc/states/MenuState.java | [new file with mode: 0644] | patch | blob |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameItems.java b/core/src/ru/deadsoftware/cavedroid/game/GameItems.java
index 61b3af736653e9097b30df8f49ca1d6c0cfd280d..da430773336efa771a35be542ad0bae8efcb3883 100644 (file)
JsonValue item = json.child.next.child;
while (block != null) {
String key = block.name;
- int left = (block.has("left") ? block.getInt("left") : 0);
- int right = (block.has("right") ? block.getInt("right") : 0);
- int top = (block.has("top") ? block.getInt("top") : 0);
- int bottom = (block.has("bottom") ? block.getInt("bottom") : 0);
- int hp = (block.has("hp") ? block.getInt("hp") : -1);
- String drop = (block.has("drop") ? block.getString("drop") : key);
- boolean collision = (!block.has("collision") || block.getBoolean("collision"));
- boolean background = (block.has("background") && block.getBoolean("background"));
- boolean transparent = !(!block.has("collision") || block.getBoolean("collision"));
- boolean blockRequired = (block.has("block_required") && block.getBoolean("block_required"));
- boolean fluid = (block.has("fluid") && block.getBoolean("fluid"));
- String meta = (block.has("meta") ? block.getString("meta") : "");
- String texture = (block.has("texture") ? block.getString("texture") : key);
+ int left = block.has("left") ? block.getInt("left") : 0;
+ int right = block.has("right") ? block.getInt("right") : 0;
+ int top = block.has("top") ? block.getInt("top") : 0;
+ int bottom = block.has("bottom") ? block.getInt("bottom") : 0;
+ int hp = block.has("hp") ? block.getInt("hp") : -1;
+ String drop = block.has("drop") ? block.getString("drop") : key;
+ boolean collision = !block.has("collision") || block.getBoolean("collision");
+ boolean background = block.has("background") && block.getBoolean("background");
+ boolean transparent = block.has("transparent") && block.getBoolean("transparent");
+ boolean blockRequired = block.has("block_required") && block.getBoolean("block_required");
+ boolean fluid = block.has("fluid") && block.getBoolean("fluid");
+ String meta = block.has("meta") ? block.getString("meta") : "";
+ String texture = block.has("texture") ? block.getString("texture") : key;
Sprite sprite = key.equals("none") ? null :
new Sprite(new Texture(Gdx.files.internal("textures/blocks/" + texture + ".png")));
Block newBlock = new Block(
}
while (item != null) {
String key = item.name;
- String name = (item.has("name") ? item.getString("name") : key);
- String type = (item.has("type") ? item.getString("type") : "item");
- String texture = (item.has("texture") ? item.getString("texture") : key);
+ String name = item.has("name") ? item.getString("name") : key;
+ String type = item.has("type") ? item.getString("type") : "item";
+ String texture = item.has("texture") ? item.getString("texture") : key;
Sprite sprite = type.equals("block") ? null :
new Sprite(new Texture(Gdx.files.internal("textures/items/" + texture + ".png")));
itemsIds.put(key, items.size);
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java
index 93d0b6f9d25c12227a99577a19f9b9244c4a7cf1..b47b600aa517c470d1a7e9a286e76c78627c59b5 100644 (file)
public class FallingGravel extends Mob {
+ ^
public FallingGravel(float x, float y) {
super(x, y, 16, 16, 0);
mov = new Vector2(0, 1);
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/ControlMode.java b/core/src/ru/deadsoftware/cavedroid/misc/ControlMode.java
--- /dev/null
@@ -0,0 +1,4 @@
+package ru.deadsoftware.cavedroid.game;
+
+public class ControlMode {
+}
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/AppState.java b/core/src/ru/deadsoftware/cavedroid/misc/states/AppState.java
similarity index 100%
rename from core/src/ru/deadsoftware/cavedroid/misc/AppState.java
rename to core/src/ru/deadsoftware/cavedroid/misc/states/AppState.java
rename from core/src/ru/deadsoftware/cavedroid/misc/AppState.java
rename to core/src/ru/deadsoftware/cavedroid/misc/states/AppState.java
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/states/GameState.java b/core/src/ru/deadsoftware/cavedroid/misc/states/GameState.java
--- /dev/null
@@ -0,0 +1,4 @@
+package ru.deadsoftware.cavedroid.misc;
+
+public enum GameState {
+}
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/states/MenuState.java b/core/src/ru/deadsoftware/cavedroid/misc/states/MenuState.java
--- /dev/null
@@ -0,0 +1,4 @@
+package ru.deadsoftware.cavedroid.misc.states;
+
+public enum MenuState {
+}