diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r-- | core/src/ch/asynk/rustanddust/RustAndDust.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/screens/MenuScreen.java | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java index 3e4d70d..c36c856 100644 --- a/core/src/ch/asynk/rustanddust/RustAndDust.java +++ b/core/src/ch/asynk/rustanddust/RustAndDust.java @@ -163,7 +163,7 @@ public class RustAndDust extends Game private void loadMenuAssets() { - manager.load("data/map_a.png", Texture.class); + manager.load("data/map_00.png", Texture.class); manager.load("data/menu.atlas", TextureAtlas.class); manager.finishLoading(); menuAtlas = manager.get("data/menu.atlas", TextureAtlas.class); @@ -171,7 +171,7 @@ public class RustAndDust extends Game private void unloadMenuAssets() { - manager.unload("data/map_a.png"); + manager.unload("data/map_00.png"); manager.unload("data/menu.atlas"); } diff --git a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java index 8997eb4..d9d2221 100644 --- a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java +++ b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java @@ -32,8 +32,9 @@ public class MenuScreen implements Screen private float delay = 0.0f; private float dx; private float dy; - private int[] xPath = { 369, 558, 747, 936, 1125, 1030, 936, 1125, 1314, 1408, 1597}; - private int[] yPath = { 565, 565, 565, 565, 565, 729, 892, 892, 892, 1056, 1056}; + private int[] xPath = { 907, 812, 908, 1098, 1288, 1384, 1481, 1578}; + private int[] yPath = { 491, 653, 818, 818, 818, 984, 1150, 1316}; + private int n = xPath.length; private boolean ready; @@ -68,7 +69,7 @@ public class MenuScreen implements Screen this.gameAssetsLoading = false; - this.bg = game.manager.get("data/map_a.png", Texture.class); + this.bg = game.manager.get("data/map_00.png", Texture.class); this.unit = new Sprite(game.menuAtlas.findRegion("unit")); this.move = new Sprite(game.menuAtlas.findRegion("move")); @@ -156,8 +157,9 @@ public class MenuScreen implements Screen } percent = Interpolation.linear.apply(percent, game.manager.getProgress(), 0.1f); - int idx = (int) (percent * 10); - float fraction = ((percent * 100 ) % 10 / 10); + float p = (percent * (xPath.length - 1)); + int idx = (int) p; + float fraction = (p - idx); x = (xPath[idx] + ((xPath[idx + 1] - xPath[idx]) * fraction)); y = (yPath[idx] + ((yPath[idx + 1] - yPath[idx]) * fraction)); } |