settlers.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. const genGame = () => {
  2. const items = [];
  3. // Resource Cards
  4. // 20
  5. [...Array(20)].forEach((_, v) => {
  6. items.push({
  7. type: "image",
  8. content: "/games/settlers/clay.png",
  9. backContent: "/games/settlers/back.png",
  10. width: 150,
  11. x: 100 - v,
  12. y: 300 - v,
  13. });
  14. items.push({
  15. type: "image",
  16. content: "/games/settlers/stone.png",
  17. backContent: "/games/settlers/back.png",
  18. width: 150,
  19. x: 300 - v,
  20. y: 300 - v,
  21. });
  22. items.push({
  23. type: "image",
  24. content: "/games/settlers/wood.png",
  25. backContent: "/games/settlers/back.png",
  26. width: 150,
  27. x: 500 - v,
  28. y: 300 - v,
  29. });
  30. items.push({
  31. type: "image",
  32. content: "/games/settlers/wheat.png",
  33. backContent: "/games/settlers/back.png",
  34. width: 150,
  35. x: 700 - v,
  36. y: 300 - v,
  37. });
  38. items.push({
  39. type: "image",
  40. content: "/games/settlers/sheep.png",
  41. backContent: "/games/settlers/back.png",
  42. width: 150,
  43. x: 900 - v,
  44. y: 300 - v,
  45. });
  46. });
  47. // search
  48. items.push({
  49. type: "image",
  50. content: "/games/settlers/cathedral.png",
  51. backContent: "/games/settlers/back.png",
  52. width: 150,
  53. x: 100,
  54. y: 700,
  55. });
  56. [...Array(15)].forEach((_, v) => {
  57. items.push({
  58. type: "image",
  59. content: "/games/settlers/knight.png",
  60. backContent: "/games/settlers/back.png",
  61. width: 150,
  62. x: 300 - v,
  63. y: 700 - v,
  64. });
  65. });
  66. items.push({
  67. type: "image",
  68. content: "/games/settlers/librarie.png",
  69. backContent: "/games/settlers/back.png",
  70. width: 150,
  71. x: 500,
  72. y: 700,
  73. });
  74. items.push({
  75. type: "image",
  76. content: "/games/settlers/market.png",
  77. backContent: "/games/settlers/back.png",
  78. width: 150,
  79. x: 700,
  80. y: 700,
  81. });
  82. [...Array(2)].forEach((_, v) => {
  83. items.push({
  84. type: "image",
  85. content: "/games/settlers/progress.png",
  86. backContent: "/games/settlers/back.png",
  87. width: 150,
  88. x: 900 - v,
  89. y: 700 - v,
  90. });
  91. });
  92. [...Array(2)].forEach((_, v) => {
  93. items.push({
  94. type: "image",
  95. content: "/games/settlers/progress2.png",
  96. backContent: "/games/settlers/back.png",
  97. width: 150,
  98. x: 1100 - v,
  99. y: 700 - v,
  100. });
  101. });
  102. [...Array(2)].forEach((_, v) => {
  103. items.push({
  104. type: "image",
  105. content: "/games/settlers/progress3.png",
  106. backContent: "/games/settlers/back.png",
  107. width: 150,
  108. x: 1300 - v,
  109. y: 700 - v,
  110. });
  111. });
  112. items.push({
  113. type: "image",
  114. content: "/games/settlers/universty.png",
  115. backContent: "/games/settlers/back.png",
  116. width: 150,
  117. x: 1500,
  118. y: 700,
  119. });
  120. items.push({
  121. type: "image",
  122. content: "/games/settlers/cathedral.png",
  123. backContent: "/games/settlers/back.png",
  124. width: 150,
  125. x: 1700,
  126. y: 700,
  127. });
  128. items.push({
  129. type: "image",
  130. content: "/games/settlers/cathedral.png",
  131. backContent: "/games/settlers/back.png",
  132. width: 150,
  133. x: 1700,
  134. y: 700,
  135. });
  136. // Tiles
  137. [...Array(3)].forEach((_, v) => {
  138. items.push({
  139. type: "image",
  140. content: "/games/settlers/tileClay.png",
  141. backContent: "/games/settlers/tileBack.png",
  142. width: 300,
  143. x: 100 - v,
  144. y: 1000 - v,
  145. rotation: 30,
  146. });
  147. });
  148. [...Array(3)].forEach((_, v) => {
  149. items.push({
  150. type: "image",
  151. content: "/games/settlers/tileStone.png",
  152. backContent: "/games/settlers/tileBack.png",
  153. width: 300,
  154. x: 400 - v,
  155. y: 1000 - v,
  156. rotation: 30,
  157. });
  158. });
  159. [...Array(4)].forEach((_, v) => {
  160. items.push({
  161. type: "image",
  162. content: "/games/settlers/tileSheep.png",
  163. backContent: "/games/settlers/tileBack.png",
  164. width: 300,
  165. x: 700 - v,
  166. y: 1000 - v,
  167. rotation: 30,
  168. });
  169. });
  170. [...Array(4)].forEach((_, v) => {
  171. items.push({
  172. type: "image",
  173. content: "/games/settlers/tileWheat.png",
  174. backContent: "/games/settlers/tileBack.png",
  175. width: 300,
  176. x: 1000 - v,
  177. y: 1000 - v,
  178. rotation: 30,
  179. });
  180. });
  181. [...Array(4)].forEach((_, v) => {
  182. items.push({
  183. type: "image",
  184. content: "/games/settlers/tileWood.png",
  185. backContent: "/games/settlers/tileBack.png",
  186. width: 300,
  187. x: 1300 - v,
  188. y: 1000 - v,
  189. rotation: 30,
  190. });
  191. });
  192. items.push({
  193. type: "image",
  194. content: "/games/settlers/tileDesert.png",
  195. backContent: "/games/settlers/tileBack.png",
  196. width: 300,
  197. x: 1600,
  198. y: 1000,
  199. rotation: 30,
  200. });
  201. [...Array(9)].forEach((_, v) => {
  202. items.push({
  203. type: "image",
  204. content: "/games/settlers/tileSea2.png",
  205. backContent: "/games/settlers/tileBack.png",
  206. width: 300,
  207. x: 1900 - v,
  208. y: 1000 - v,
  209. rotation: 30,
  210. });
  211. });
  212. [...Array(4)].forEach((_, v) => {
  213. items.push({
  214. type: "image",
  215. content: "/games/settlers/portAll.png",
  216. backContent: "/games/settlers/tileBack.png",
  217. width: 300,
  218. x: 300 - v,
  219. y: 1400 - v,
  220. rotation: 30,
  221. });
  222. });
  223. items.push({
  224. type: "image",
  225. content: "/games/settlers/portClay.png",
  226. backContent: "/games/settlers/tileBack.png",
  227. width: 300,
  228. x: 600,
  229. y: 1400,
  230. rotation: 30,
  231. });
  232. items.push({
  233. type: "image",
  234. content: "/games/settlers/portStone.png",
  235. backContent: "/games/settlers/tileBack.png",
  236. width: 300,
  237. x: 900,
  238. y: 1400,
  239. rotation: 30,
  240. });
  241. items.push({
  242. type: "image",
  243. content: "/games/settlers/portSheep.png",
  244. backContent: "/games/settlers/tileBack.png",
  245. width: 300,
  246. x: 1200,
  247. y: 1400,
  248. rotation: 30,
  249. });
  250. items.push({
  251. type: "image",
  252. content: "/games/settlers/portWheat.png",
  253. backContent: "/games/settlers/tileBack.png",
  254. width: 300,
  255. x: 1500,
  256. y: 1400,
  257. rotation: 30,
  258. });
  259. items.push({
  260. type: "image",
  261. content: "/games/settlers/portWood.png",
  262. backContent: "/games/settlers/tileBack.png",
  263. width: 300,
  264. x: 1800,
  265. y: 1400,
  266. rotation: 30,
  267. });
  268. // Tokens
  269. [...Array(5)].forEach((_, v) => {
  270. items.push({
  271. type: "image",
  272. content: "/games/settlers/houseRed.png",
  273. width: 70,
  274. x: 100 + 100 * v,
  275. y: 1800,
  276. });
  277. });
  278. [...Array(4)].forEach((_, v) => {
  279. items.push({
  280. type: "image",
  281. content: "/games/settlers/house2red.png",
  282. width: 90,
  283. x: 100 + 100 * v,
  284. y: 1900,
  285. });
  286. });
  287. [...Array(15)].forEach((_, v) => {
  288. items.push({
  289. type: "rect",
  290. color: "#FF0000",
  291. width: 20,
  292. height: 100,
  293. x: 700 + 40 * v,
  294. y: 1800,
  295. });
  296. });
  297. [...Array(5)].forEach((_, v) => {
  298. items.push({
  299. type: "image",
  300. content: "/games/settlers/houseBlue.png",
  301. width: 70,
  302. x: 100 + 100 * v,
  303. y: 2050,
  304. });
  305. });
  306. [...Array(4)].forEach((_, v) => {
  307. items.push({
  308. type: "image",
  309. content: "/games/settlers/house2Blue.png",
  310. width: 90,
  311. x: 100 + 100 * v,
  312. y: 2100,
  313. });
  314. });
  315. [...Array(15)].forEach((_, v) => {
  316. items.push({
  317. type: "rect",
  318. color: "#0000FF",
  319. width: 20,
  320. height: 100,
  321. x: 700 + 40 * v,
  322. y: 2050,
  323. });
  324. });
  325. [...Array(5)].forEach((_, v) => {
  326. items.push({
  327. type: "image",
  328. content: "/games/settlers/houseOrange.png",
  329. width: 70,
  330. x: 100 + 100 * v,
  331. y: 2250,
  332. });
  333. });
  334. [...Array(4)].forEach((_, v) => {
  335. items.push({
  336. type: "image",
  337. content: "/games/settlers/house2Orange.png",
  338. width: 90,
  339. x: 100 + 100 * v,
  340. y: 2300,
  341. });
  342. });
  343. [...Array(15)].forEach((_, v) => {
  344. items.push({
  345. type: "rect",
  346. color: "#ff6600",
  347. width: 20,
  348. height: 100,
  349. x: 700 + 40 * v,
  350. y: 2250,
  351. });
  352. });
  353. [...Array(5)].forEach((_, v) => {
  354. items.push({
  355. type: "image",
  356. content: "/games/settlers/houseWhite.png",
  357. width: 70,
  358. x: 100 + 100 * v,
  359. y: 2450,
  360. });
  361. });
  362. [...Array(4)].forEach((_, v) => {
  363. items.push({
  364. type: "image",
  365. content: "/games/settlers/house2White.png",
  366. width: 90,
  367. x: 100 + 100 * v,
  368. y: 2500,
  369. });
  370. });
  371. [...Array(15)].forEach((_, v) => {
  372. items.push({
  373. type: "rect",
  374. color: "#ffd5d5",
  375. width: 20,
  376. height: 100,
  377. x: 700 + 40 * v,
  378. y: 2450,
  379. });
  380. });
  381. items.push({
  382. type: "image",
  383. content: "/games/settlers/rogue.png",
  384. x: 100,
  385. y: 2700,
  386. });
  387. return {
  388. items,
  389. board: { size: 4000, scale: 0.5 },
  390. };
  391. };
  392. const game = genGame();
  393. export default game;