123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- const genGame = () => {
- const items = [];
- // Resource Cards
- // 20
- [...Array(20)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/clay.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 100 - v,
- y: 300 - v,
- });
- items.push({
- type: "image",
- content: "/games/settlers/stone.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 300 - v,
- y: 300 - v,
- });
- items.push({
- type: "image",
- content: "/games/settlers/wood.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 500 - v,
- y: 300 - v,
- });
- items.push({
- type: "image",
- content: "/games/settlers/wheat.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 700 - v,
- y: 300 - v,
- });
- items.push({
- type: "image",
- content: "/games/settlers/sheep.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 900 - v,
- y: 300 - v,
- });
- });
- // search
- items.push({
- type: "image",
- content: "/games/settlers/cathedral.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 100,
- y: 700,
- });
- [...Array(15)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/knight.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 300 - v,
- y: 700 - v,
- });
- });
- items.push({
- type: "image",
- content: "/games/settlers/librarie.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 500,
- y: 700,
- });
- items.push({
- type: "image",
- content: "/games/settlers/market.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 700,
- y: 700,
- });
- [...Array(2)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/progress.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 900 - v,
- y: 700 - v,
- });
- });
- [...Array(2)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/progress2.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 1100 - v,
- y: 700 - v,
- });
- });
- [...Array(2)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/progress3.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 1300 - v,
- y: 700 - v,
- });
- });
- items.push({
- type: "image",
- content: "/games/settlers/universty.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 1500,
- y: 700,
- });
- items.push({
- type: "image",
- content: "/games/settlers/cathedral.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 1700,
- y: 700,
- });
- items.push({
- type: "image",
- content: "/games/settlers/cathedral.png",
- backContent: "/games/settlers/back.png",
- width: 150,
- x: 1700,
- y: 700,
- });
- // Tiles
- [...Array(3)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileClay.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 100 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- [...Array(3)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileStone.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 400 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileSheep.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 700 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileWheat.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1000 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileWood.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1300 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- items.push({
- type: "image",
- content: "/games/settlers/tileDesert.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1600,
- y: 1000,
- rotation: 30,
- });
- [...Array(9)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/tileSea2.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1900 - v,
- y: 1000 - v,
- rotation: 30,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/portAll.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 300 - v,
- y: 1400 - v,
- rotation: 30,
- });
- });
- items.push({
- type: "image",
- content: "/games/settlers/portClay.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 600,
- y: 1400,
- rotation: 30,
- });
- items.push({
- type: "image",
- content: "/games/settlers/portStone.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 900,
- y: 1400,
- rotation: 30,
- });
- items.push({
- type: "image",
- content: "/games/settlers/portSheep.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1200,
- y: 1400,
- rotation: 30,
- });
- items.push({
- type: "image",
- content: "/games/settlers/portWheat.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1500,
- y: 1400,
- rotation: 30,
- });
- items.push({
- type: "image",
- content: "/games/settlers/portWood.png",
- backContent: "/games/settlers/tileBack.png",
- width: 300,
- x: 1800,
- y: 1400,
- rotation: 30,
- });
- // Tokens
- [...Array(5)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/houseRed.png",
- width: 70,
- x: 100 + 100 * v,
- y: 1800,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/house2red.png",
- width: 90,
- x: 100 + 100 * v,
- y: 1900,
- });
- });
- [...Array(15)].forEach((_, v) => {
- items.push({
- type: "rect",
- color: "#FF0000",
- width: 20,
- height: 100,
- x: 700 + 40 * v,
- y: 1800,
- });
- });
- [...Array(5)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/houseBlue.png",
- width: 70,
- x: 100 + 100 * v,
- y: 2050,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/house2Blue.png",
- width: 90,
- x: 100 + 100 * v,
- y: 2100,
- });
- });
- [...Array(15)].forEach((_, v) => {
- items.push({
- type: "rect",
- color: "#0000FF",
- width: 20,
- height: 100,
- x: 700 + 40 * v,
- y: 2050,
- });
- });
- [...Array(5)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/houseOrange.png",
- width: 70,
- x: 100 + 100 * v,
- y: 2250,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/house2Orange.png",
- width: 90,
- x: 100 + 100 * v,
- y: 2300,
- });
- });
- [...Array(15)].forEach((_, v) => {
- items.push({
- type: "rect",
- color: "#ff6600",
- width: 20,
- height: 100,
- x: 700 + 40 * v,
- y: 2250,
- });
- });
- [...Array(5)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/houseWhite.png",
- width: 70,
- x: 100 + 100 * v,
- y: 2450,
- });
- });
- [...Array(4)].forEach((_, v) => {
- items.push({
- type: "image",
- content: "/games/settlers/house2White.png",
- width: 90,
- x: 100 + 100 * v,
- y: 2500,
- });
- });
- [...Array(15)].forEach((_, v) => {
- items.push({
- type: "rect",
- color: "#ffd5d5",
- width: 20,
- height: 100,
- x: 700 + 40 * v,
- y: 2450,
- });
- });
- items.push({
- type: "image",
- content: "/games/settlers/rogue.png",
- x: 100,
- y: 2700,
- });
- return {
- items,
- board: { size: 4000, scale: 0.5 },
- };
- };
- const game = genGame();
- export default game;
|