Skip to content

Commit

Permalink
json and rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
aghull committed Mar 22, 2024
1 parent bd53aef commit d3542a3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
29 changes: 23 additions & 6 deletions game.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,36 @@
"ui": {
"root": ".",
"build": {
"dev": ["npm run tsc", "npm run build:ui"],
"prod": ["npm run tsc", "npm run build:ui:prod"]
"dev": [
"npm run typecheck",
"npm run build:ui"
],
"prod": [
"npm run typecheck",
"npm run build:ui:prod"
]
},
"watchPaths": ["src/ui", "src/game", "node_modules/@boardzilla/core/src"],
"watchPaths": [
"src/ui",
"src/game"
],
"outDir": "build/ui"
},
"game": {
"root": ".",
"build": {
"dev": ["npm run tsc", "npm run build:game"],
"prod": ["npm run tsc", "npm run build:game:prod"]
"dev": [
"npm run typecheck",
"npm run build:game"
],
"prod": [
"npm run typecheck",
"npm run build:game:prod"
]
},
"watchPaths": ["src/game", "node_modules/@boardzilla/core/src"],
"watchPaths": [
"src/game"
],
"out": "build/game/game-interface.js"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "boardzilla-starter-game",
"name": "boardzilla-tiles-starter-game",
"version": "1.1",
"license": "MIT",
"type": "module",
"dependencies": {
"@boardzilla/core": "^0.2.0",
"react": "^18.2",
"react-dom": "^18.2"
},
Expand All @@ -20,11 +21,11 @@
"dev": "bz run -root .",
"info": "bz info -root .",
"submit": "bz submit -root .",
"typecheck": "tsc --noEmit",
"build:ui": "npx node esbuild.ui.mjs",
"build:ui:prod": "NODE_ENV=production npx node esbuild.ui.mjs",
"build:game": "npx node esbuild.game.mjs",
"build:game:prod": "NODE_ENV=production npx node esbuild.game.mjs",
"tsc": "tsc --noEmit",
"test": "vitest"
},
"private": true
Expand Down
5 changes: 3 additions & 2 deletions src/game/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export default createGame(MyGamePlayer, MyGame, game => {
}).chooseOnBoard(
'token', $.pool.all(Token),
).placePiece(
'token', player.my(PieceGrid)!
'token', player.my(PieceGrid)!, {
rotationChoices: [0, 90, 180, 270]
}
).message(
`{{player}} drew a {{token}} token.`
)
Expand All @@ -86,7 +88,6 @@ export default createGame(MyGamePlayer, MyGame, game => {
game.announce('intro');
},


loop(
eachPlayer({
name: 'player',
Expand Down

0 comments on commit d3542a3

Please sign in to comment.