Code Monkey home page Code Monkey logo

bored-games's Introduction

This project was bootstrapped with Create React App.

Environment Dependencies

Ubuntu 20.04 Node: v18.4.0
npm: 8.12.1

Ubuntu 18.04 Node: v17.9.1 (Since Node v18.4.0 requires GLIBC_2.28)
npm: 8.11.0

Available Scripts

In the project directory, you can run:

npm run start:app

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm run start:server

Runs the server in development mode.

npm run start:server:watch

Runs the server in development mode.

The server will reload if you make edits.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

The build includes both React and server files.
The React bundle is located under build/public.

Your app is ready to be deployed!

See the section about deployment for more information.

npm start

Runs the app in production mode.
Open http://localhost:8080 to view it in the browser.

npm test:app

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run lint

Runs tslint against the server.

npm pack

Builds the app for production if the build folder does not exist.
See the section npm run build for more details.

Packages the minimal necessities for production deployment.
The npm package is ready for publishing!

The package can be deployed after unpacking and running npm install --only=production and npm start.

Alternatively, the Docker directory contains build and update scripts for docker deployment.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

bored-games's People

Contributors

b-tsao avatar ibm-btsao avatar kenwardt avatar katsoohoo avatar

Watchers

James Cloos avatar  avatar

bored-games's Issues

Give BGIOClient a toolbar for actions

BGIOClient should have a toolbar that allows players to interact with the framework (like restarting the game for host, returning to lobby, etc) (To be designed)

Drag discard

Ideally, I would like some hover effect and one-click to discard, but then we would have to change how to select kongs and claims.

One-click actions for claims, win, and kong in hand

Dependent on #17.

When server has logic to detect claim options, we can implement one-click actions on the UI for the following:

  • During claim stage, show actions if discarded tile is claimable. Possible actions are chow, pong, kong, and win.
  • During discard stage, show kong and win action when possible.

With this, we don't need to select specify tiles anymore and instead present possible combinations.

Client logic should check what claimable options (kong, pong, chow) are available during claim phase

Server will parse the hand along with the last discarded tile to retrieve possible combinations.
EDIT: Upon design thinking, it makes more sense for client to process the hand during claim phase for available players.
Reason: The server would have to process for 3 players, in addition to the processing for all on-going games, it just makes sense for individual clients to process their own hand and find available combinations, sending the index of the tiles in the player's hand for which they want to combo it with the discard (basically what the server expects the client to pass in currently, but manually).

Security wise, there should be no issue as the server knows what are in the players hand and the client sends the index of the tile position within the player's hand.

If no combinations are available, player will have an auto-skip passed in from the client once the timer is up (Issue #16)

If possible combinations are available, they should be categorized and presented to the player to pick one of the combinations or skip.

Client side auto timer

Due to limitations of boardgame.io, server sided timers currently are not possible. The server will continue to expect actions per stage while the client will handle any automated actions like auto-skipping a tile. Exact timer should be configurable.

Add fun interactions

We can add fun interactions in the game for players waiting on other players, like throwing eggs or tomatoes at other players. (Especially the one taking too long)

Rearrange top player's hand layout

Players are ordered in the following positions:

Top
Left Right
Bottom

The top player's current hand layout is:

Exposed Hand
--------------------
Concealed Hand

This layout needs to be changed to:

Concealed Hand
--------------------
Exposed Hand

Automatically draw tiles

Automatically draw tiles for players.

Cases:

  • During player's draw phase, automatically draw from the beginning.
  • Player draws a flower, automatically draw from the end.
  • Player claims or declares a kong, automatically draw from the end.

Chatroom

A chatroom will be added as a layer over games

Allow mahjong to go a full round

Mahjong starts with the east player rolling the dice. If the player rolling the dice wins, they keep the dice. If they lose, the dice moves counter clockwise to the next player. Once the dice makes a full round (back to the east), that's one game session.

Add game information

  • Dealer (starting East seat, always same person) - use icon
  • Current dice holder (rotates) - use icon
  • Prevalent Wind - use Mahjong unicode
  • Number of tiles left
  • Number of dead tiles(?)

Return length of opponents' concealed kongs

On the server side, concealed kongs from other players are currently structured below.

  "players": {
    "0": {
      "hand": 8,
      "concealed": [
        "kong",
        "kong"
      ],

We should include the length of the kong to avoid using a magic number on the client.

After fixing the above, the client needs to update OpponentHand to consume the new format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.