diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-14 08:29:24 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-14 08:29:24 +0200 |
commit | 94e780a885330797664a09b3a32f4cd809b2395a (patch) | |
tree | 621a3829543998428eb118916c8746b47b6e2542 /core/src/ch/asynk/gdx/boardgame/boards | |
parent | 4d8559eb03abfd918e12c124f1c56df39bd134cb (diff) | |
download | gdx-boardgame-94e780a885330797664a09b3a32f4cd809b2395a.zip gdx-boardgame-94e780a885330797664a09b3a32f4cd809b2395a.tar.gz |
Orientation : normalize 0° is facing East
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/boards')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java | 3 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java index 30aef0b..c78fb77 100644 --- a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java +++ b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java @@ -33,8 +33,9 @@ public class HexBoard implements Board // rows are vertical° // bottom left is the left vertice of the most bottom-left horizontal hex side of the map - private static final int [] vAngles = {330, -1, 30, 90, 150, -1, 210, 270, 330}; - private static final int [] hAngles = { 0, 0, 60, -1, 120, 180, 240, -1, 300}; + // [0] is 0° facing East + private static final int [] vAngles = {60, 0, 60, -1, 120, 180, 240, -1, 300}; + private static final int [] hAngles = {90, -1, 30, 90, 150, -1, 210, 270, 330}; public HexBoard(float side, float x0, float y0, BoardFactory.BoardOrientation boardOrientation) { diff --git a/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java index bfe23a7..665d1ca 100644 --- a/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java +++ b/core/src/ch/asynk/gdx/boardgame/boards/SquareBoard.java @@ -8,7 +8,8 @@ public class SquareBoard implements Board private final float x0; // bottom left x offset private final float y0; // bottom left y offset - private static final int [] angles = { 0, 0, -1, 90, -1, 180, -1, 270, -1}; + // [0] is 0° facing East + private static final int [] angles = {90, 0, -1, 90, -1, 180, -1, 270, -1, 0}; public SquareBoard(float side, float x0, float y0) { diff --git a/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java index f49550d..1fbd034 100644 --- a/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java +++ b/core/src/ch/asynk/gdx/boardgame/boards/TriangleBoard.java @@ -16,8 +16,9 @@ public class TriangleBoard implements Board private final float h23; // 2/3 height of the triangle private final float h43; // 4/3 height of the triangle - private static final int [] vAngles = {330, -1, 30, 90, 150, -1, 210, 270, 330}; - private static final int [] hAngles = { 0, 0, 60, -1, 120, 180, 240, -1, 300}; + // [0] is 0° facing East + private static final int [] vAngles = {60, 0, 60, -1, 120, 180, 240, -1, 300}; + private static final int [] hAngles = {30, -1, 30, 90, 150, -1, 210, 270, 330}; public TriangleBoard(float side, float x0, float y0, BoardFactory.BoardOrientation boardOrientation) { |