Skip to main content

Search

Turn Based logic for board game, how to start and end a turn

  • FlashMedallion

    Why don't you have two high level keyframes - Player 1 Turn and Player 2 Turn.
    When it's Player 1 Turn, that keyframe is active and sets all the counters, scores, and variables to Player1s values. So if you only want player one to be able to move their own pieces, then each piece has a grab tag, the grab is powered by a variable, and in Player 1 Turn the variable is 1 and in Player 2 Turn the variable is 0.

    Ending your turn switches the Keyframes over.

  • Supposer

    A selector gadget sends a signal to one of many outputs. It allows you to cycle through these outputs with logic. So if you hook your "player 1" logic to slot A in the selector, and "player 2" logic to slot B, only one of them will be active at a time. And to move change the turn to the other player, send a signal to the "next" input on the gadget.

    https://docs.google.com/document/d/1gvFqQl84-kEIO0u3PRTXmXMQDEcnV8kCm80bLNur_7M/edit#heading=h.qpc7vbebh9nv

  • Agarwel

    This is a little tricky question. There are many ways how to achieve it, and to choose the best way, it depends on what the other logic looks like (is it for two peplo, or the second player is AI? Do they use one two controllers, or share one, etc...)
    But basically, I would use the selector with two outputs. And each time player ends the turn, they would switch the output to the other one. And then each output would have logic for that player.

    It could be some complex microchip on each output. Or just a simple tag for each output and rest of the level logic could just detect active tag to decide what is happening. (for example you could only move certain pieces if certain tag is active. Making sure blue player can move blue pieces and red player can move red pieces etc...)

Please sign in to leave a comment.