Giter VIP home page Giter VIP logo

cardsgame's People

Contributors

dependabot[bot] avatar greenly-builder avatar zielak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cardsgame's Issues

[example] Makao/UNO game

Fully playable Makao/UNO style game.

Server

  • all actions and rules implemented
  • every action unit tested, for integrity

Client:

  • fully playable on desktop
  • fully playable on mobile, with proper interface on both portrait and landscape view

[Client] helper for finding stuff at any given time

Query selector could be exposed to general utils?
Client's room/state could have find() method.
"Find utility" could be just present in client library.

  • Usage should be the same as on the server for consistency.

[Client] State Children

  • Acts the same way as Colyseus Schema: you can add listeners there.
  • TwoSided entities should new prop revealed to reflect the faceUp&ownership, so each component didn't had to do this: (props.faceUp || props.ownerID === gameState.clientID)

[server] clone stuff instead od moving them

Moving entities around (new parent) seems to be buggy with colyseus new Schema.

  • clone() method on all entities
  • clone also clones OR moves all children (depends on the result)
  • factory of all entities instead of constructors

[example] different renderer examples

  • client package should provide "adapters". Let game author choose how he wants to render each Entity
  • examples package should show both options: React and Pixi.

Unit tests everywhere

unit test everything you wrote so far.

GOAL - make it at least YELLOW

Goal achieved!

image

  • entities (just init them)
  • [๐Ÿ‘Œ50%] commands
  • [๐Ÿ‘Œ67%] conditions
  • [x] selectors (what was that?)
  • traits
  • [๐Ÿ‘Œ88%] traits/parent
  • [25%] utils (so small, could be left for later.)
  • src/ room and commandsManager? Their shape still changes, gonna leave it for now.

Rounds

  • rounds count in state
  • [ ] rounds should count up after the last player's TURN is finished they shouldn't automatically, it's up to game author.
  • nextRound command
  • non turn based gameplay, doesn't care about player turns

[server] better logTreeState

image

This could be better:

  • don't draw pipe where it's not needed (in column after last child)
  • use emoji in place of Pub indicator (entity with public/private props)
  • more colors? to indicate children count, type and name more clearly

I switched to debugging in Chrome dev tools, which has collapsable log groups. Server logging should still be available when running server remotely, so this ticket is still valid.

Remove Pixi dependency

Consider ditching Pixi dependency in favor of "choosing your own renderer".

Pixi is currently in @cardsgame/client and every Entity is rendered with it.
Instead it could be moved to @cards/examples:

  • client should not import pixi.

UI interaction

Make it possible to define actions (with ActionTemplate) which would react to UI interaction: button click , slider value change, radio button change etc (all basic HTML events).
On top of current game Entity interactions.


For now I focused on just button clicks

Possibility to mark containers as Player's main container (eg. Hand)

Server:

  • It will be possible to mark any container as focused/playersMain (new interface?)

Client:

  • container will be rendered as player's main container on client, preferably on bottom, maybe enlarged a bit?
  • rest of the containers will be rendered depending on the game
  • provide some default rendering options, like: "in circle (current player on bottom)"

  • shared IPlayerViewPosition, so both sides speak the same language
  • isInOwnersView on the entities
  • ownerID to make any decisions on positioning client-side
  • handle window resize
  • set rules on how to render all the other players

Example implementation

Provide a true, small example implementation. cardsGame-examples is growing out of its initial scope.

[Server] rethink Line container

No directionality, just use angle.

Padding between elements?
Or
Set number of elements + Line width would determine spacing?

Cant run example: Default transport not set error

Hi there, tried to run your example and I failed.

/home/ddv/dev/examples/cardGameProjects/cardsGame/packages/server/node_modules/@colyseus/core/build/Server.js:157
        throw new Error("Please provide a 'transport' layer. Default transport not set.");
        ^

Error: Please provide a 'transport' layer. Default transport not set.
    at Server.getDefaultTransport (/home/ddv/dev/examples/cardGameProjects/cardsGame/packages/server/node_modules/@colyseus/core/build/Server.js:157:15)

Remove event emmiters traits

Instead of adding new thing, see if current State has any change listeners on server side.

  • Deck - some games might need to reshuffle cards from pile when deck empties.
  • Hand needs to notify "MAKAO!" to other players when a player has the last card in his hands.

[Server] JSON entities parser

Have a big amount of cards? Scrape them from JSON file, assign a correct "type" in each and server will create an array of these items for you.

Actions possible to log messages

Server-side defined actions currently have name and description. I could create new field, which would be logged client-side in the "game history log" to know which player did what.
Inspired by how they do it at https://dominion.games

  • nice to have: not plain-text:
    • Player names can be hovered to reveal their details (avatar, name, link to profile etc)
    • Cards can be hovered to reveal their visual representation
    • An action as a whole can be "replayed" in ghost animation, to see where the card was and where it's headed.
  • not all actions require that (de/selecting cards)

Text fields on the table

  • Should Text be able to be owned by players?
  • Should it respond to interactions?
  • Should it obey idx and be possible to put in containers, or just be there on the table?

Use cases:

  • background on some play areas, to indicate it's purpose (SUPER HOT's multiple areas)
    • this could be handled just by creating new kind of container: Area?
  • helper text, next to:
    • players, to indicate their points/health/cash
    • decks, to indicate how many cards are left - not every game would allow such feature
  • ...

Not everything needs x, y, angle

I'm sending a lot of data on every single change, due to restyling of entities.

  • Cards in any container don't need to have a transform on server.
  • Deck, Hand, Row etc, should have their children positioned in the client.
  • Pile's cardsData:
    • could be sent to client, to make their offset consistent across all clients,
    • could be ignored, and each client would store their own cardsData, only for each client's consistency.

Selecting cards, different way

Find a way for selecting/marking cards without the need for additional container.
Use it in a different game, leave Makao as it is right now.

  • single click with mouse
  • swipe up/down with touch control

RevealUI for multiple players

Reveal/Hide UI commands should accept more than one player. Some games might require it.

Put these commands in the core cardsGame lib, here.

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.