Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nicolo John Davis
    @nicolodavis
    We use some Unix specific commands in dev.sh which need to be converted to something more platform agnostic.
    I've spelled out a manual workaround on the issue that you can use until this is fixed.
    Thanks for bringing this to my attention.
    @chuckeeguo @jonborchardt I haven't fully caught up with the issue you were both discussing. Feel free to file an issue if anything is still not resolved.
    A Codesandbox link is always helpful to the person trying to debug.
    Justin Carruthers
    @Jtcruthers
    I'm super hype about phases-overhaul. Can we expect that release in the coming weeks? Thanks for all your hard work on this project
    Nicolo John Davis
    @nicolodavis
    As soon as the docs are ready. Can't promise a timeline, but you can already start using it directly from the repo.
    You don't really need to wait for a release of you're eager to start using it.
    Just use npm link.
    Nicolo John Davis
    @nicolodavis
    Alternatively, I can release a canary package somewhere that you can use to start testing, but using the repo directly is probably the most straightforward.
    Justin Carruthers
    @Jtcruthers
    I'll npm link it and start testing it tonight. Thanks again!
    Chris Swithinbank
    @delucis
    @Jtcruthers There are some instructions for using the package with npm link here: https://github.com/nicolodavis/boardgame.io/issues/394#issuecomment-525679629
    Good luck!
    Iván Pérez
    @lukegothic
    Hello, has anyone here that has successfully implemented a card drafting game using bg.io? 2 simple phases, draft (until no more cards are available) and play. I'd also thank if anyone can share any examples of real board games implemented with bg.io
    Amit Portnoy
    @amitport
    @lukegothic github search is your friend https://github.com/search?q=boardgame.io
    Tony Mullen
    @tonymullen
    What's the best way to call a function that changes game state at an interval? I'd like to have a setup phase where cards are dealt to players and have cards added to player hands at about .5 second increments until the cards are dealt. Player hands are part of game state. Should I use moves for this? If so, how should I trigger the move on an interval?
    Tony Mullen
    @tonymullen
    Also/alternately, how can I access a move from within a phase event? I think I want to use onPhaseBegin to trigger the card dealing, and then use a move to deal each card in succession. So that's 52 game state changes.
    Tony Mullen
    @tonymullen
    Also, how to set a start player programmatically? Trying ctx.events.endTurn({ next: startPlayer }); in "onPhaseBegin" but this doesn't work.
    Nicolo John Davis
    @nicolodavis
    @tonymullen You can't trigger moves from within other moves or events.
    You should call your card dealing logic directly inside the phase event.
    But now that you mention it, it might be a nice idea to be able to trigger moves for the sake of the moves being reported on the game log.
    About setting start players programmatically, take a look at https://boardgame.io/documentation/#/turn-order
    Some of this code will change in the next release, but it should be easy to migrate.
    Tony Mullen
    @tonymullen
    Thanks! Calling the card dealing logic in phase event works fine, but then all the cards are dealt in a single state change. This is okay, but it doesn't let me dole out cards at intervals. Is there any way to do that?
    Tony Mullen
    @tonymullen
    With regard to turn order, I want the default round robin, but I'm not seeing how to set currentPlayer explicitly, to start with a player other than 0. Ctx is read only, right?
    Nicolo John Davis
    @nicolodavis
    Yes, you will need to create a custom turn order.
    The link above explains how to do that.
    About dealing cards at intervals, that isn't possible at the moment.
    You can simulate the effect on the client-side of course.
    but the game logic just sees one large state change
    Tony Mullen
    @tonymullen
    Thanks, I'll work on that.
    Iván Pérez
    @lukegothic
    @amitport thanks, I'm still looking for a "card draft" example
    It might be useful to have code snippets for common board game implementations inside the documentation page, what do you think about that?
    Nicolo John Davis
    @nicolodavis
    Yes, I think having some examples about how to do card drafting etc. would be quite helpful.
    Tony Mullen
    @tonymullen
    Got the order working. Thanks!
    Nicolo John Davis
    @nicolodavis
    Hey all, I wrote down some thoughts about our UI framework offering: nicolodavis/boardgame.io#455
    Let me know what you think!
    TheOtherGuy
    @TheOtherGuy
    Hi, can I check will it be possible to use boardgame.io to create a game which involves each player moving multiple units on a board and attacking the opponent's units ?
    Nicolo John Davis
    @nicolodavis
    Yes, this is possible.
    Haoyang Feng
    @haoyangnz
    What's the recommended technique of styling the lobby?
    Say I want to hide the lobby once the game starts and just create a button to exit game
    Tony Mullen
    @tonymullen
    Can a move be allowed by more than one phase? I'm having an issue where a move is working fine in one phase, but when the phase changes the move stops triggering, even though both phases list the move in allowedMoves.
    Nicolo John Davis
    @nicolodavis
    Yes a move can be allowed in multiple phases.
    Can you post a link to your code?
    The move should get called here:
    Line 25 is the move that's not triggering in the "finishGame" phase. It triggers in "play"
    Could be a problem with turnorder in finishGame, I don't know if that's close to working as it should