networked loss state

This commit is contained in:
LadyEbony 2020-08-22 01:44:52 -07:00
parent 9ce29be2af
commit 2c7bceb8c3
2 changed files with 250 additions and 3 deletions

View file

@ -157,9 +157,7 @@ public class GameBoard : EntityBase, IAutoSerialize, IAutoDeserialize {
return;
case DelayState.None:
if (HighestStack(board) >= 13) {
delayState = DelayState.Loss;
StartCoroutine(HandleLoss(3f));
RaiseEvent('l', true);
// TODO - Do a bunch of networking silliness to end the game here
}
@ -628,6 +626,12 @@ public class GameBoard : EntityBase, IAutoSerialize, IAutoDeserialize {
bool stateDirty = false;
[NetEvent('l')]
void SendLossState(){
delayState = DelayState.Loss;
StartCoroutine(HandleLoss(3f));
}
[Header("Network")]
public float networkTick = 0.1f;
private float nextNetworkTick;