testGame.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. const genGame = () => {
  2. const items = [];
  3. items.push({
  4. type: "image",
  5. content: "/game_assets/AS.jpg",
  6. backContent: "/game_assets/Red_back.jpg",
  7. text: "frontLabel",
  8. width: 100,
  9. x: 400,
  10. y: 400,
  11. actions: [
  12. "flip",
  13. "flipSelf",
  14. "tap",
  15. { name: "rotate", args: { angle: 25 } },
  16. "rotate45",
  17. "rotate90",
  18. "stack",
  19. "shuffle",
  20. "clone",
  21. "lock",
  22. "remove",
  23. ],
  24. });
  25. items.push({
  26. type: "image",
  27. content: "/game_assets/BH.jpg",
  28. backContent: "/game_assets/Red_back.jpg",
  29. text: "frontLabel",
  30. backText: "backLabel",
  31. width: 100,
  32. x: 410,
  33. y: 400,
  34. });
  35. items.push({
  36. type: "image",
  37. content: "/game_assets/JC.jpg",
  38. backContent: "/game_assets/Red_back.jpg",
  39. overlay: { content: "/game_assets/overlay.png" },
  40. width: 100,
  41. x: 420,
  42. y: 400,
  43. });
  44. items.push({
  45. type: "rect",
  46. color: "#00D022",
  47. width: 100,
  48. height: 100,
  49. x: 0,
  50. y: 0,
  51. });
  52. items.push({
  53. type: "rect",
  54. color: "#22D022",
  55. width: 80,
  56. height: 80,
  57. x: 10,
  58. y: 10,
  59. });
  60. items.push({
  61. type: "rect",
  62. color: "#ffffff",
  63. width: 80,
  64. height: 80,
  65. text: "test2",
  66. textColor: "#ccc",
  67. x: 400,
  68. y: 100,
  69. });
  70. items.push({
  71. type: "rect",
  72. color: "#000",
  73. width: 80,
  74. height: 80,
  75. text: "test4",
  76. textColor: "#ccc",
  77. x: 420,
  78. y: 120,
  79. });
  80. items.push({
  81. type: "round",
  82. color: "#D00022",
  83. text: "test",
  84. textColor: "#ccc",
  85. radius: 80,
  86. x: 500,
  87. y: 500,
  88. });
  89. items.push({
  90. type: "round",
  91. color: "#ffffff",
  92. radius: 80,
  93. text: "test3",
  94. textColor: "#ccc",
  95. x: 700,
  96. y: 400,
  97. });
  98. items.push({
  99. type: "round",
  100. color: "#000",
  101. radius: 80,
  102. text: "test4",
  103. textColor: "#ccc",
  104. x: 720,
  105. y: 400,
  106. });
  107. items.push({
  108. label: "Counter",
  109. type: "counter",
  110. color: "#D00022",
  111. x: 50,
  112. y: 50,
  113. });
  114. items.push({
  115. label: "Dice",
  116. type: "dice",
  117. color: "#D00022",
  118. x: 200,
  119. y: 50,
  120. });
  121. items.push({
  122. label: "Note",
  123. type: "note",
  124. color: "#ffc",
  125. x: 200,
  126. y: 200,
  127. });
  128. items.push({
  129. label: "My zone",
  130. type: "zone",
  131. layer: -1,
  132. width: 500,
  133. height: 300,
  134. locked: true,
  135. onItem: ["reveal"],
  136. x: 200,
  137. y: 600,
  138. });
  139. items.push({
  140. label: "My cube",
  141. type: "cube",
  142. size: 70,
  143. color: "#ff0000",
  144. x: 400,
  145. y: 550,
  146. });
  147. items.push({
  148. text: "My token",
  149. type: "token",
  150. size: 70,
  151. color: "#00ff00",
  152. x: 450,
  153. y: 600,
  154. });
  155. items.push({
  156. label: "My meeple",
  157. type: "meeple",
  158. size: 70,
  159. color: "#0000ff",
  160. x: 600,
  161. y: 650,
  162. });
  163. items.push({
  164. label: "My jewel",
  165. type: "jewel",
  166. size: 70,
  167. color: "#00ffff",
  168. x: 650,
  169. y: 550,
  170. });
  171. items.push({
  172. label: "My jewel",
  173. type: "jewel",
  174. size: 70,
  175. color: "#ff0000",
  176. x: 650,
  177. y: 600,
  178. });
  179. items.push({
  180. label: "Generator",
  181. type: "generator",
  182. layer: -1,
  183. x: 500,
  184. y: 700,
  185. item: {
  186. label: "My jewel",
  187. type: "jewel",
  188. size: 70,
  189. color: "#ff0000",
  190. },
  191. });
  192. return {
  193. items,
  194. availableItems: [
  195. {
  196. name: "Blue rect",
  197. label: "rect",
  198. type: "rect",
  199. color: "#0000D2",
  200. width: 80,
  201. height: 80,
  202. },
  203. {
  204. name: "First group",
  205. items: [
  206. {
  207. name: "Green rect",
  208. label: "rect",
  209. type: "rect",
  210. color: "#00D022",
  211. width: 80,
  212. height: 80,
  213. },
  214. {
  215. label: "Red rect",
  216. type: "rect",
  217. color: "#D00022",
  218. width: 80,
  219. height: 80,
  220. },
  221. ],
  222. },
  223. {
  224. name: "Second group",
  225. items: [
  226. {
  227. name: "Green pawn",
  228. label: "rect",
  229. type: "pawn",
  230. color: "#00D022",
  231. size: 80,
  232. },
  233. {
  234. name: "Red pawn",
  235. type: "pawn",
  236. color: "#D00022",
  237. size: 80,
  238. },
  239. {
  240. name: "blue pawn",
  241. type: "pawn",
  242. color: "#2000D2",
  243. size: 80,
  244. },
  245. {
  246. name: "Third nested group",
  247. items: [
  248. {
  249. name: "Green rect",
  250. label: "rect",
  251. type: "rect",
  252. color: "#00D022",
  253. width: 80,
  254. height: 80,
  255. },
  256. {
  257. name: "Red rect",
  258. type: "rect",
  259. color: "#D00022",
  260. width: 80,
  261. height: 80,
  262. },
  263. ],
  264. },
  265. ],
  266. },
  267. {
  268. name: "Green circle",
  269. label: "round",
  270. type: "round",
  271. color: "#00D022",
  272. size: 80,
  273. },
  274. {
  275. name: "Red circle",
  276. type: "round",
  277. color: "#D00022",
  278. size: 80,
  279. },
  280. ],
  281. board: {
  282. size: 1000,
  283. scale: 1,
  284. name: "Test Game",
  285. published: true,
  286. keepTitle: true,
  287. translations: [
  288. {
  289. language: "fr",
  290. name: "0 Jeu test",
  291. description: "Un jeu pour tester",
  292. baseline: "Un jeu de test",
  293. },
  294. ],
  295. playerCount: [2, 4],
  296. defaultName: "0 Test game",
  297. defaultLanguage: "en",
  298. defaultDescription: "A classic",
  299. defaultBaseline: "A test game",
  300. materialLanguage: "Multi-lang",
  301. minAge: "10",
  302. duration: [30, 90],
  303. imageUrl: "/game_assets/default.png",
  304. gridSize: 1,
  305. },
  306. id: "test",
  307. };
  308. };
  309. export const testGame = genGame();
  310. export default testGame;