RecBox-Games / HoldEm

BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Player Animations Will Buddy Up #2

Closed DigitalSRC closed 1 year ago

DigitalSRC commented 1 year ago

For some reason the player capsules will buddy up and move into scene together. One will leave leaving the correct players (whos turn it is) there.

They will also stack on each other sometimes on a new round.

DigitalSRC commented 1 year ago

I figured out the reasoning why this can happen. The call, raise, and fold functions can be accessed separately from the nextTurn() function which handles switching the players. The controller will need functionality for an update from nextTurn() that will allow the coroutines to finish before moving on to the next player.

Essentially the players turn starts, this needs to send an update to the controller allowing for the player to input something for their turn, this response then needs to come back down to the game and THEN the game can proceed to process the turn. Currently there is no call back and fourth which leads to turns being able to go extremely fast which will break the animations if players already know what they wish to do on their turn and are ready for it and quickly do it.

The routines need to stall and achieving this should be done by a check from the controller.

DigitalSRC commented 1 year ago

Going all in will also stall the game into a stack overflow error in the movePlayer() function. I think this has to do with the above. Im not entirely sure why when both players going all in does this but I think with a check and receive call like above then it might fix the animation issues.

rbays30 commented 1 year ago

Just fixed this I think

I added some coroutines to your coroutines to make sure the animation has finished before proceeding with game-side code. Check it out and let me know what you think

rbays30 commented 1 year ago

Attempting close