-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a84d030
Showing
13 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/node_modules | ||
/build | ||
/.save-states | ||
/package-lock.json | ||
/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as esbuild from 'esbuild' | ||
import { sassPlugin } from 'esbuild-sass-plugin' | ||
|
||
const env = process.env.NODE_ENV || "development" | ||
const minify = env === "production" | ||
const sourcemap = env === "production" ? false : "inline" | ||
|
||
await esbuild.build({ | ||
format: 'iife', | ||
globalName: 'game', | ||
loader: { | ||
'.jpg': 'file', | ||
'.png': 'file', | ||
'.svg': 'file', | ||
'.webp': 'file', | ||
'.scss': 'css', | ||
'.ogg': 'dataurl', | ||
}, | ||
sourcemap, | ||
sourceRoot: "src/game", | ||
keepNames: true, | ||
sourcemap: 'inline', | ||
outdir: 'build/game', | ||
entryPoints: ['src/game/game-interface.ts'], | ||
bundle: true, | ||
minify, | ||
plugins: [sassPlugin()] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as esbuild from 'esbuild' | ||
import { sassPlugin } from 'esbuild-sass-plugin' | ||
|
||
const env = process.env.NODE_ENV || "development" | ||
const minify = env === "production" | ||
const sourcemap = env === "production" ? false : "inline" | ||
|
||
await esbuild.build({ | ||
format: 'iife', | ||
assetNames: 'assets/[name]-[hash]', | ||
loader: { | ||
'.jpg': 'file', | ||
'.png': 'file', | ||
'.svg': 'file', | ||
'.webp': 'file', | ||
'.scss': 'css', | ||
'.ogg': 'dataurl', | ||
}, | ||
sourcemap, | ||
sourceRoot: "src/ui", | ||
keepNames: true, | ||
sourcemap: 'inline', | ||
outfile: 'build/ui/index.js', | ||
entryPoints: ['./src/ui/'], | ||
bundle: true, | ||
minify, | ||
plugins: [sassPlugin()] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"minPlayers": 1, | ||
"maxPlayers": 4, | ||
"ui": { | ||
"root": ".", | ||
"build": { | ||
"dev": "npm run build:ui", | ||
"prod": "npm run build:ui:prod" | ||
}, | ||
"watchPaths": [ | ||
"src/ui", | ||
"src/game" | ||
], | ||
"outDir": "build/ui" | ||
}, | ||
"game": { | ||
"root": ".", | ||
"build": { | ||
"dev": "npm run build:game", | ||
"prod": "npm run build:game:prod" | ||
}, | ||
"watchPaths": [ | ||
"src/game" | ||
], | ||
"out": "build/game/game-interface.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules | ||
/.save-states | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module "*.png"; | ||
declare module "*.ogg"; | ||
declare module "*.svg"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "boardzilla-starter-game", | ||
"version": "1.0.5", | ||
"license": "MIT", | ||
"type": "module", | ||
"dependencies": { | ||
"@boardzilla/core": "^0.0.59", | ||
"@boardzilla/devtools": "^0.0.50", | ||
"react": "^18.2", | ||
"react-dom": "^18.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.8.7", | ||
"@types/react": "^18.2.25", | ||
"@types/react-dom": "^18.2.14", | ||
"esbuild": "^0.19.2", | ||
"esbuild-sass-plugin": "^2.15.0", | ||
"typescript": "^5.2.2" | ||
}, | ||
"scripts": { | ||
"dev": "bz run -root .", | ||
"info": "bz info -root .", | ||
"submit": "bz submit -root .", | ||
"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" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import setup from './index.js'; | ||
import { createInteface } from '@boardzilla/core'; | ||
|
||
const { initialState, processMove, getPlayerState } = createInteface(setup) | ||
export { initialState, processMove, getPlayerState }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
createGame, | ||
createBoardClasses, | ||
Player, | ||
Board, | ||
} from '@boardzilla/core'; | ||
|
||
export class MyGamePlayer extends Player<MyGamePlayer, MyGameBoard> { | ||
}; | ||
|
||
class MyGameBoard extends Board<MyGamePlayer, MyGameBoard> { | ||
} | ||
|
||
const { Space, Piece } = createBoardClasses<MyGamePlayer, MyGameBoard>(); | ||
|
||
export default createGame(MyGamePlayer, MyGameBoard, game => { | ||
|
||
const { board, action } = game; | ||
const { playerActions, loop, eachPlayer } = game.flowCommands; | ||
|
||
board.registerClasses(); | ||
|
||
game.defineActions({ | ||
}); | ||
|
||
game.defineFlow( | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { render } from '@boardzilla/core'; | ||
import { default as setup } from '../game/index.js'; | ||
|
||
import './style.scss'; | ||
import '@boardzilla/core/index.css'; | ||
|
||
render(setup, { | ||
settings: { | ||
}, | ||
layout: board => { | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#play-area { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "nodenext", | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, | ||
"jsx": "react", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["src", "./index.d.ts"], | ||
"exclude": ["**/node_modules", "**/.*/"] | ||
} |