diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 23:52:57 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 23:52:57 +0200 | 
| commit | 331143ef593ce24a76f6caadcd5f9dcce8783fb5 (patch) | |
| tree | 884e9bdf48321b9e15d28812eba40d6223d1d98a | |
| parent | c4d43b7a87bab33f1486af3d6ace82750026d0f9 (diff) | |
| download | RustAndDust-331143ef593ce24a76f6caadcd5f9dcce8783fb5.zip RustAndDust-331143ef593ce24a76f6caadcd5f9dcce8783fb5.tar.gz | |
MoveToAnimation: fix rotation
| -rw-r--r-- | android/assets/images/counters.atlas | 68 | ||||
| -rw-r--r-- | android/assets/images/counters.png | bin | 153395 -> 288231 bytes | |||
| -rw-r--r-- | android/assets/images/cup.jpg | bin | 12266 -> 0 bytes | |||
| -rw-r--r-- | android/assets/images/dice.pack | 46 | ||||
| -rw-r--r-- | android/assets/images/dice.png | bin | 10986 -> 0 bytes | |||
| -rw-r--r-- | android/assets/images/small.png | bin | 2145 -> 0 bytes | |||
| -rw-r--r-- | android/assets/images/us.atlas | 24 | ||||
| -rw-r--r-- | android/assets/images/us.png | bin | 322153 -> 316459 bytes | |||
| -rw-r--r-- | build.gradle | 1 | ||||
| -rw-r--r-- | core/src/ch/asynk/tankontank/TankOnTank.java | 6 | ||||
| -rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java | 13 | ||||
| -rw-r--r-- | data/counters/ace.png | bin | 0 -> 17386 bytes | |||
| -rw-r--r-- | data/counters/ap_1.png | bin | 0 -> 20533 bytes | |||
| -rw-r--r-- | data/counters/ap_2.png | bin | 0 -> 22626 bytes | |||
| -rw-r--r-- | data/counters/ap_3.png | bin | 0 -> 22565 bytes | |||
| -rw-r--r-- | data/counters/ap_4.png | bin | 0 -> 22101 bytes | |||
| -rw-r--r-- | data/counters/ap_spent.png | bin | 0 -> 24185 bytes | |||
| -rw-r--r-- | data/counters/back.png | bin | 0 -> 17872 bytes | |||
| -rw-r--r-- | data/counters/turn_back.png | bin | 0 -> 18221 bytes | |||
| -rw-r--r-- | data/counters/turn_front.png | bin | 0 -> 17210 bytes | |||
| -rw-r--r-- | data/misc/ge-black.png | bin | 0 -> 7787 bytes | |||
| -rw-r--r-- | data/misc/ge-blue.png | bin | 0 -> 2472 bytes | |||
| -rw-r--r-- | data/misc/ge-flag.png | bin | 0 -> 6037 bytes | |||
| -rw-r--r-- | data/misc/ge-green.png | bin | 0 -> 2469 bytes | |||
| -rw-r--r-- | data/misc/ge-red.png | bin | 0 -> 2471 bytes | |||
| -rw-r--r-- | data/misc/images.jpe | bin | 0 -> 9123 bytes | |||
| -rw-r--r-- | data/misc/us-black.png | bin | 0 -> 104031 bytes | |||
| -rw-r--r-- | data/misc/us-blue.png | bin | 0 -> 13200 bytes | |||
| -rw-r--r-- | data/misc/us-flag.png | bin | 0 -> 21857 bytes | |||
| -rw-r--r-- | data/misc/us-green.png | bin | 0 -> 13011 bytes | |||
| -rw-r--r-- | data/misc/us-pawn.png | bin | 0 -> 5881 bytes | |||
| -rw-r--r-- | data/misc/us-red.png | bin | 0 -> 12588 bytes | |||
| -rw-r--r-- | data/us/sherman.png | bin | 13506 -> 4044 bytes | 
33 files changed, 93 insertions, 65 deletions
| diff --git a/android/assets/images/counters.atlas b/android/assets/images/counters.atlas new file mode 100644 index 0000000..9f0de4a --- /dev/null +++ b/android/assets/images/counters.atlas @@ -0,0 +1,68 @@ + +counters.png +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +ace +  rotate: false +  xy: 2, 128 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: -1 +ap +  rotate: false +  xy: 2, 2 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: 1 +ap +  rotate: false +  xy: 128, 128 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: 2 +ap +  rotate: false +  xy: 128, 2 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: 3 +ap +  rotate: false +  xy: 254, 128 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: 4 +ap_spent +  rotate: false +  xy: 254, 2 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: -1 +back +  rotate: false +  xy: 380, 128 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: -1 +turn_back +  rotate: false +  xy: 380, 2 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: -1 +turn_front +  rotate: false +  xy: 506, 128 +  size: 124, 124 +  orig: 124, 124 +  offset: 0, 0 +  index: -1 diff --git a/android/assets/images/counters.png b/android/assets/images/counters.pngBinary files differ index b9bbb0d..1b493f9 100644 --- a/android/assets/images/counters.png +++ b/android/assets/images/counters.png diff --git a/android/assets/images/cup.jpg b/android/assets/images/cup.jpgBinary files differ deleted file mode 100644 index 6f02296..0000000 --- a/android/assets/images/cup.jpg +++ /dev/null diff --git a/android/assets/images/dice.pack b/android/assets/images/dice.pack deleted file mode 100644 index 0e8385a..0000000 --- a/android/assets/images/dice.pack +++ /dev/null @@ -1,46 +0,0 @@ -dice.png -format: RGBA8888 -filter: Nearest,Nearest -repeat: none -d1 -  rotate: false -  xy: 1, 1 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 1 -d2 -  rotate: false -  xy: 31, 1 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 2 -d3 -  rotate: false -  xy: 61, 1 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 3 -d4 -  rotate: false -  xy: 1, 31 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 4 -d5 -  rotate: false -  xy: 31, 31 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 5 -d6 -  rotate: false -  xy: 61, 31 -  size: 30, 30 -  orig: 30, 30 -  offset: 0, 0 -  index: 6 diff --git a/android/assets/images/dice.png b/android/assets/images/dice.pngBinary files differ deleted file mode 100644 index 0ce9454..0000000 --- a/android/assets/images/dice.png +++ /dev/null diff --git a/android/assets/images/small.png b/android/assets/images/small.pngBinary files differ deleted file mode 100644 index d0c8445..0000000 --- a/android/assets/images/small.png +++ /dev/null diff --git a/android/assets/images/us.atlas b/android/assets/images/us.atlas index e60ff69..9f7f164 100644 --- a/android/assets/images/us.atlas +++ b/android/assets/images/us.atlas @@ -5,70 +5,70 @@ filter: Nearest,Nearest  repeat: none  at-gun    rotate: false -  xy: 473, 128 +  xy: 346, 280    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  head    rotate: false -  xy: 2, 77 +  xy: 2, 10    size: 175, 175    orig: 175, 175    offset: 0, 0    index: -1  infantry    rotate: false -  xy: 599, 128 +  xy: 472, 280    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  pershing    rotate: false -  xy: 851, 128 +  xy: 724, 280    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  pershing-hq    rotate: false -  xy: 725, 128 +  xy: 598, 280    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  priest    rotate: false -  xy: 473, 2 +  xy: 850, 280    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  sherman    rotate: false -  xy: 331, 112 -  size: 140, 140 -  orig: 140, 140 +  xy: 2, 187 +  size: 190, 217 +  orig: 190, 217    offset: 0, 0    index: -1  sherman-head    rotate: false -  xy: 179, 102 +  xy: 194, 254    size: 150, 150    orig: 150, 150    offset: 0, 0    index: -1  sherman-hq    rotate: false -  xy: 599, 2 +  xy: 194, 128    size: 124, 124    orig: 124, 124    offset: 0, 0    index: -1  wolverine    rotate: false -  xy: 725, 2 +  xy: 179, 2    size: 124, 124    orig: 124, 124    offset: 0, 0 diff --git a/android/assets/images/us.png b/android/assets/images/us.pngBinary files differ index 11743cb..5fe8f07 100644 --- a/android/assets/images/us.png +++ b/android/assets/images/us.png diff --git a/build.gradle b/build.gradle index 292b9b7..a354fe6 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,7 @@ allprojects {              add 'ge'              add 'hex'              add 'unit' +            add 'counters'          }      }  } diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java index c2283dc..49cd23b 100644 --- a/core/src/ch/asynk/tankontank/TankOnTank.java +++ b/core/src/ch/asynk/tankontank/TankOnTank.java @@ -32,14 +32,11 @@ public class TankOnTank extends Game          Gdx.app.debug("TankOnTank", "  load assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");          manager.load("images/map_a.png", Texture.class);          manager.load("images/map_b.png", Texture.class); -        manager.load("images/dice.pack", TextureAtlas.class);          manager.load("images/counters.pack", TextureAtlas.class);          manager.load("images/ge.atlas", TextureAtlas.class);          manager.load("images/us.atlas", TextureAtlas.class);          manager.load("images/hex.atlas", TextureAtlas.class);          manager.load("images/unit.atlas", TextureAtlas.class); -        // manager.load("images/cup.jpg", Texture.class); -        // manager.load("images/small.png", Texture.class);      }      public void unloadAssets() @@ -48,14 +45,11 @@ public class TankOnTank extends Game          Gdx.app.debug("TankOnTank", "diagnostics:\n" + manager.getDiagnostics() );          manager.unload("images/map_a.png");          manager.unload("images/map_b.png"); -        manager.unload("images/dice.pack");          manager.unload("images/counters.pack");          manager.unload("images/ge.atlas");          manager.unload("images/us.atlas");          manager.unload("images/hex.atlas");          manager.unload("images/unit.atlas"); -        // manager.unload("images/cup.jpg"); -        // manager.unload("images/small.png");          Gdx.app.debug("TankOnTank", "diagnostics:\n" + manager.getDiagnostics() );      } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java index 9a48db4..aa2e630 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java @@ -14,6 +14,7 @@ public class MoveToAnimation extends TimedAnimation      private float toX;      private float toY;      private float toR; +    private float rDelta;      private static final Pool<MoveToAnimation> moveToAnimationPool = new Pool<MoveToAnimation>() {          @Override @@ -36,6 +37,7 @@ public class MoveToAnimation extends TimedAnimation          a.toY = y;          a.toR = r;          a.duration = duration; +        a.rDelta = 0;          return a;      } @@ -58,6 +60,15 @@ public class MoveToAnimation extends TimedAnimation          fromX = pawn.getX();          fromY = pawn.getY();          fromR = pawn.getRotation(); + +        if (Math.abs(toR - fromR) <= 180.f) +            rDelta = (toR - fromR); +        else { +            if (toR > fromR) +                rDelta = (toR - 360 - fromR); +            else +                rDelta = (toR + 360 - fromR); +        }      }      @Override @@ -72,6 +83,6 @@ public class MoveToAnimation extends TimedAnimation          if (percent == 1f)              pawn.setPosition(toX, toY, (int) toR);          else -            pawn.setPosition(fromX + ((toX - fromX) * percent), fromY + ((toY - fromY) * percent), (int) (fromR + ((toR - fromR) * percent))); +            pawn.setPosition(fromX + ((toX - fromX) * percent), fromY + ((toY - fromY) * percent), (fromR + (rDelta * percent)));      }  } diff --git a/data/counters/ace.png b/data/counters/ace.pngBinary files differ new file mode 100644 index 0000000..f4f3240 --- /dev/null +++ b/data/counters/ace.png diff --git a/data/counters/ap_1.png b/data/counters/ap_1.pngBinary files differ new file mode 100644 index 0000000..c47d15e --- /dev/null +++ b/data/counters/ap_1.png diff --git a/data/counters/ap_2.png b/data/counters/ap_2.pngBinary files differ new file mode 100644 index 0000000..e89956a --- /dev/null +++ b/data/counters/ap_2.png diff --git a/data/counters/ap_3.png b/data/counters/ap_3.pngBinary files differ new file mode 100644 index 0000000..7d1b11f --- /dev/null +++ b/data/counters/ap_3.png diff --git a/data/counters/ap_4.png b/data/counters/ap_4.pngBinary files differ new file mode 100644 index 0000000..e897628 --- /dev/null +++ b/data/counters/ap_4.png diff --git a/data/counters/ap_spent.png b/data/counters/ap_spent.pngBinary files differ new file mode 100644 index 0000000..cb399d8 --- /dev/null +++ b/data/counters/ap_spent.png diff --git a/data/counters/back.png b/data/counters/back.pngBinary files differ new file mode 100644 index 0000000..e7eb5ef --- /dev/null +++ b/data/counters/back.png diff --git a/data/counters/turn_back.png b/data/counters/turn_back.pngBinary files differ new file mode 100644 index 0000000..3f681d8 --- /dev/null +++ b/data/counters/turn_back.png diff --git a/data/counters/turn_front.png b/data/counters/turn_front.pngBinary files differ new file mode 100644 index 0000000..b08806b --- /dev/null +++ b/data/counters/turn_front.png diff --git a/data/misc/ge-black.png b/data/misc/ge-black.pngBinary files differ new file mode 100644 index 0000000..bf00d77 --- /dev/null +++ b/data/misc/ge-black.png diff --git a/data/misc/ge-blue.png b/data/misc/ge-blue.pngBinary files differ new file mode 100644 index 0000000..b516d7c --- /dev/null +++ b/data/misc/ge-blue.png diff --git a/data/misc/ge-flag.png b/data/misc/ge-flag.pngBinary files differ new file mode 100644 index 0000000..8c4fc85 --- /dev/null +++ b/data/misc/ge-flag.png diff --git a/data/misc/ge-green.png b/data/misc/ge-green.pngBinary files differ new file mode 100644 index 0000000..15721f5 --- /dev/null +++ b/data/misc/ge-green.png diff --git a/data/misc/ge-red.png b/data/misc/ge-red.pngBinary files differ new file mode 100644 index 0000000..cc71025 --- /dev/null +++ b/data/misc/ge-red.png diff --git a/data/misc/images.jpe b/data/misc/images.jpeBinary files differ new file mode 100644 index 0000000..7c3516e --- /dev/null +++ b/data/misc/images.jpe diff --git a/data/misc/us-black.png b/data/misc/us-black.pngBinary files differ new file mode 100644 index 0000000..701dffd --- /dev/null +++ b/data/misc/us-black.png diff --git a/data/misc/us-blue.png b/data/misc/us-blue.pngBinary files differ new file mode 100644 index 0000000..45962de --- /dev/null +++ b/data/misc/us-blue.png diff --git a/data/misc/us-flag.png b/data/misc/us-flag.pngBinary files differ new file mode 100644 index 0000000..848149c --- /dev/null +++ b/data/misc/us-flag.png diff --git a/data/misc/us-green.png b/data/misc/us-green.pngBinary files differ new file mode 100644 index 0000000..90b1435 --- /dev/null +++ b/data/misc/us-green.png diff --git a/data/misc/us-pawn.png b/data/misc/us-pawn.pngBinary files differ new file mode 100644 index 0000000..f75672c --- /dev/null +++ b/data/misc/us-pawn.png diff --git a/data/misc/us-red.png b/data/misc/us-red.pngBinary files differ new file mode 100644 index 0000000..4368c72 --- /dev/null +++ b/data/misc/us-red.png diff --git a/data/us/sherman.png b/data/us/sherman.pngBinary files differ index 4c62be2..cd5cc8f 100644 --- a/data/us/sherman.png +++ b/data/us/sherman.png | 
