kevinddchen / machikoro

Implementation of the Machi Koro boardgame

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Machi Koro

This is an implementation of the Machi Koro board game. This app was developed using the React framework and the boardgame.io game engine.

Disclaimer: We do not own a license to the game.

Play

The app is online and free to play at playmachikoro.herokuapp.com.

Rules

Supply variants

  • Total: All establishments are available for purchase. This is the official supply variant of Machi Koro.
  • Variable: 10 establishments are available for purchase. This is the official supply variant of the expansions.
  • Hybrid: 5 establishments with rolls 1-6, 5 establishments with rolls 7+, and 2 major establishments are available for purchase. This is the official supply variant of Machi Koro 2.

Implementation details

In the Millionaire's Row expansion, there are certain uncommon plays that are not possible:

  • Demolition Company cannot be activated after Corn Field. This is uncommon because you could get fewer coins.
  • Loan Office cannot be activated after Forest or Flower Shop. This is uncommon because you could get fewer coins.
  • Moving Company cannot be activated before Mine, Winery, or Apple Orchard. This is done because (i) you could get fewer coins, and (ii) it is ambiguous whether establishments you give away should be activated, so this keeps things simple.
  • Renovation Company cannot be activated before Tax Office. This is uncommon because you could get fewer coins.
  • Exhibit Hall cannot be activated before Tech Startup (e.g. to activate Loan Office). While this could give you more coins, (i) it is quite rare, and (ii) activating Tech Startup first makes it more clean how many coins you have which can help with picking the establishment to activate.

Development

First, install Node.js. Then, clone this repo and install the project dependencies.

git clone git@github.com:kevinddchen/machikoro.git
cd machikoro
npm install

We recommend using VS Code as your code editor. Some contribution guidelines:

  • Run npm run lint:fix to run code linting and check for syntax errors.
  • Run npm run prettier:fix to autoformat the code.
  • Run npm run version:fix to update the version in src/version.ts with the version in package.json.

Run locally in debug mode

In a terminal window, run the following command:

npm run serve:dev

This will start the game server. Without closing the window, open a new terminal window and run:

npm run start

This will open the app in development mode at localhost:3000 in your browser. There are some debugging tools which become unavailable in the production version of the app. Additionally, any changes made in the source code will be automatically updated in the browser, which is very convenient.

To change the debug game settings, edit debugSetupData in src/game/machikoro.ts.

Run locally in production mode

You must first build the app by running,

npm run build

Once the app has been built, you start the game server by running the same command as above,

npm run serve:prod

The app will be hosted at localhost:80. If you open multiple browsers and go to the link (e.g. incognito mode) you can play with yourself. The downside is that any changes in the code will not be reflected in the app until it is rebuilt.

Deploy to Heroku

First, install the Heroku CLI and log in by running heroku login. From the project root directory, run heroku git:remote -a playmachikoro to add the Heroku remote to Git. To deploy your local app, run

git push heroku main

This will only work if you are a collaborator.

About

Implementation of the Machi Koro boardgame

License:MIT License


Languages

Language:TypeScript 94.0%Language:CSS 5.5%Language:JavaScript 0.3%Language:HTML 0.2%Language:Procfile 0.0%