Roads and tiles defined
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
dbedd9bacb
commit
5fdf41d739
@ -52,7 +52,7 @@ const Board = ({ game }) => {
|
||||
top: `${road.top}px`,
|
||||
left: `${road.left}px`
|
||||
}}
|
||||
/>;
|
||||
>{road.index}</div>;
|
||||
};
|
||||
|
||||
const Corner = ({corner}) => {
|
||||
@ -74,7 +74,7 @@ const Board = ({ game }) => {
|
||||
top: `${corner.top}px`,
|
||||
left: `${corner.left}px`
|
||||
}}
|
||||
/>;
|
||||
></div>;
|
||||
};
|
||||
|
||||
const generateRoads = () => {
|
||||
@ -253,6 +253,7 @@ const Board = ({ game }) => {
|
||||
let row = 0, rowCount = 0;
|
||||
let y = tileHalfWidth - (rows.length - 1) * 0.5 * tileWidth,
|
||||
x = -(rows[row] - 1) * 0.5 * tileHeight;
|
||||
let index = 0;
|
||||
return game.tileOrder.map(order => {
|
||||
const tile = game.tiles[order];
|
||||
let div = <div
|
||||
@ -266,7 +267,7 @@ const Board = ({ game }) => {
|
||||
backgroundImage: `url(${assetsPath}/gfx/tiles-${tile.type}.png)`,
|
||||
backgroundPositionY: `-${tile.card*tileHeight}px`
|
||||
}}
|
||||
/>;
|
||||
></div>;
|
||||
|
||||
if (++rowCount === rows[row]) {
|
||||
row++;
|
||||
|
@ -34,6 +34,206 @@ function shuffle(array) {
|
||||
return array;
|
||||
}
|
||||
|
||||
/* Board Tiles:
|
||||
* 0 1 2
|
||||
* 3 4 5 6
|
||||
* 7 8 9 10 11
|
||||
* 12 13 14 15
|
||||
* 16 17 18
|
||||
*/
|
||||
|
||||
/*
|
||||
* c0
|
||||
* /\
|
||||
* r0 / \r1
|
||||
* c6 / \ c1
|
||||
* | |
|
||||
* r6| p,a | r2
|
||||
* c5| | c3
|
||||
* \ /
|
||||
* r5 \ / r3
|
||||
* \/
|
||||
* c4
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1| 3| 5|
|
||||
* / \ / \ / \
|
||||
* 0/ 1\ 3/ 4\ 6/ 7\
|
||||
* / \ / \ / \
|
||||
* 0| 2| 4| |6
|
||||
* 2| 0 5| 1 8| 2 |9
|
||||
* 8| 10| 12| |14
|
||||
* / \ / \ / \ / \
|
||||
* 10/ 11\ 13/ 14\ 16/ 17\ 19/ 20\
|
||||
* / \ / \ / \ / \
|
||||
* 7| 9| 11| 13| |15
|
||||
* 12| 3 15| 4 18| 5 21| 6 |22
|
||||
* 17| 19| 21| 23| |25
|
||||
* / \ / \ / \ / \ / \
|
||||
* 23/ 24\ 26/ 27\ 29/ 30\ 32/ 33\ 35/ 36\
|
||||
* / \ / \ / \ / \ / \
|
||||
* 16| 18| 20| 22| 24| |26
|
||||
* 25| 7 28| 8 31| 9 34| 10 37| 11 |38
|
||||
* 27| 29| 31| 33| 35| |37
|
||||
* \ / \ / \ / \ / \ /
|
||||
* 39\ 40/ 41\ 43/ 44\ 46/ 47\ 49/ 50\ /53
|
||||
* \ / \ / \ / \ / \ /
|
||||
* 28| 30| 32| 34| |36
|
||||
* 42| 12 45| 13 48| 14 51| 15 |52
|
||||
* 38| 40| 42| 44| |46
|
||||
* \ / \ / \ / \ /
|
||||
* 54\ 55/ 56\ 58/ 59\ 61/ 62\ /65
|
||||
* \ / \ / \ / \ /
|
||||
* 39| 41| 43| |45
|
||||
* 57| 16 60| 17 63| 18 |64
|
||||
* 47| 49| 51| |53
|
||||
* \ / \ / \ /
|
||||
* 66\ 67/ 68\ 69/ 70\ /71
|
||||
* \ / \ / \ /
|
||||
* 48| 50| 52|
|
||||
*
|
||||
*/
|
||||
const Tile = (corners, roads) => {
|
||||
return {
|
||||
corners: corners, /* 6 */
|
||||
pip: -1,
|
||||
roads: roads,
|
||||
asset: -1
|
||||
};
|
||||
};
|
||||
|
||||
/* Borders have three sections each, so they are numbered
|
||||
* 0-17 clockwise. Some corners share two borders. */
|
||||
|
||||
const Corner = (roads, banks) => {
|
||||
return {
|
||||
roads: roads, /* max of 3 */
|
||||
banks: banks, /* max of 2 */
|
||||
data: undefined
|
||||
};
|
||||
};
|
||||
|
||||
const Road = (corners) => {
|
||||
return {
|
||||
corners: corners, /* 2 */
|
||||
data: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const layout = {
|
||||
tiles: [
|
||||
Tile([ 0, 1, 2, 10, 9, 8], [ 0, 1, 5, 13, 11, 2]),
|
||||
Tile([ 2, 3, 4, 12, 11, 10], [ 3, 4, 8, 16, 14, 5]),
|
||||
Tile([ 4, 5, 6, 14, 13, 12], [ 6, 7, 9, 19, 17, 8]),
|
||||
|
||||
Tile([ 7, 8, 9, 19, 18, 17], [ 10, 11, 15, 26, 24, 12]),
|
||||
Tile([ 9, 10, 11, 21, 20, 19], [ 13, 14, 18, 29, 27, 15]),
|
||||
Tile([ 11, 12, 13, 23, 22, 21], [ 16, 17, 21, 32, 30, 18]),
|
||||
Tile([ 13, 14, 15, 25, 24, 23], [ 19, 20, 22, 35, 33, 21]),
|
||||
|
||||
Tile([ 16, 17, 18, 29, 28, 27], [ 23, 24, 18, 40, 39, 25]),
|
||||
Tile([ 18, 19, 20, 31, 30, 29], [ 26, 27, 31, 43, 41, 28]),
|
||||
Tile([ 20, 21, 22, 33, 32, 31], [ 29, 30, 34, 46, 44, 31]),
|
||||
Tile([ 22, 23, 24, 35, 34, 33], [ 32, 33, 37, 49, 47, 34]),
|
||||
Tile([ 24, 25, 26, 37, 36, 35], [ 35, 36, 38, 53, 50, 37]),
|
||||
|
||||
Tile([ 28, 29, 30, 40, 39, 38], [ 40, 41, 45, 55, 54, 42]),
|
||||
Tile([ 30, 31, 32, 42, 41, 40], [ 43, 44, 48, 58, 56, 45]),
|
||||
Tile([ 32, 33, 34, 44, 43, 42], [ 46, 47, 51, 61, 59, 48]),
|
||||
Tile([ 34, 35, 36, 46, 45, 44], [ 49, 50, 52, 65, 62, 51]),
|
||||
|
||||
Tile([ 39, 40, 41, 49, 48, 47], [ 55, 56, 60, 67, 66, 57]),
|
||||
Tile([ 41, 42, 43, 51, 50, 49], [ 58, 59, 63, 69, 68, 60]),
|
||||
Tile([ 43, 44, 45, 53, 52, 51], [ 61, 62, 64, 71, 70, 63])
|
||||
],
|
||||
roads: [
|
||||
/* 0 */
|
||||
Road([0, 1]),
|
||||
Road([1, 2]),
|
||||
Road([0, 8]),
|
||||
Road([2, 3]),
|
||||
Road([3, 4]),
|
||||
Road([2, 10]),
|
||||
Road([4, 5]),
|
||||
Road([5, 6]),
|
||||
Road([4, 12]),
|
||||
Road([6, 14]),
|
||||
/* 10 */
|
||||
Road([8, 7]),
|
||||
Road([8, 9]),
|
||||
Road([7, 17]),
|
||||
Road([9, 10]),
|
||||
Road([10, 11]),
|
||||
Road([9, 19]),
|
||||
Road([12, 11]),
|
||||
Road([12, 13]),
|
||||
Road([11, 21]),
|
||||
Road([14, 13]),
|
||||
/* 20 */
|
||||
Road([14, 15]),
|
||||
Road([13,23 ]),
|
||||
Road([15, 25]),
|
||||
Road([17, 16]),
|
||||
Road([17, 18]),
|
||||
Road([16, 27]),
|
||||
Road([19, 18]),
|
||||
Road([19, 20]),
|
||||
Road([18, 29]),
|
||||
Road([21, 20]),
|
||||
/* 30 */
|
||||
Road([21, 22]),
|
||||
Road([20, 31]),
|
||||
Road([23, 22]),
|
||||
Road([23, 24]),
|
||||
Road([22,33]),
|
||||
Road([25,24]),
|
||||
Road([25,26]),
|
||||
Road([24, 35]),
|
||||
Road([26,37]),
|
||||
Road([27,28]),
|
||||
/* 40 */
|
||||
Road([29,28]),
|
||||
Road([29,30]),
|
||||
Road([28,38]),
|
||||
Road([31,30]),
|
||||
Road([31,32]),
|
||||
Road([30,40]),
|
||||
Road([33,32]),
|
||||
Road([33,34]),
|
||||
Road([32,42]),
|
||||
Road([35,34]),
|
||||
/* 50 */
|
||||
Road([35,36]),
|
||||
Road([34,44]),
|
||||
Road([36,46]),
|
||||
Road([37,36]),
|
||||
Road([38,39]),
|
||||
Road([40,39]),
|
||||
Road([40,41]),
|
||||
Road([39,47]),
|
||||
Road([41,42]),
|
||||
Road([42,43]),
|
||||
/* 60 */
|
||||
Road([41,49]),
|
||||
Road([44,43]),
|
||||
Road([44,45]),
|
||||
Road([43,51]),
|
||||
Road([45,53]),
|
||||
Road([46,45]),
|
||||
Road([47,48]),
|
||||
Road([49,48]),
|
||||
Road([49,50]),
|
||||
Road([51,50]),
|
||||
/* 70 */
|
||||
Road([51,52]),
|
||||
Road([53,52]),
|
||||
],
|
||||
corners: [
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
const assetData = {
|
||||
tiles: [
|
||||
{ type: "desert", card: 0 },
|
||||
|
Loading…
x
Reference in New Issue
Block a user