Sign In Register

How can we help you today?

Start a new topic
Answered

turn based game -- Can I simply set the next player directly?

I want to build a poker-like game via turn-based challenge.

And the next player depends on various factor, folded? all-in? ....etc


1.

Can I use cloud code to simply "set" the next player?

Or can I use turn consume function multiple times?


2.

How can I do time-out maybe after 30 secs each turn?

After time-out, do the default move for the player to make game smoothly.


3.

Or should I not use turn-based?


Thanks a lot!

Jo


Best Answer
Hi Jo

1 - You can use consumeTurn until Spark.getData().nextPlayer is the player you want.

2- You can set up an event that set's a timer in cloud code to call the default move after 30 seconds.

3- you can use turn based

Thanks
Katie

 


hi Katie

how can we do that you mentioned? 2- You can set up an event that set's a timer in cloud code to call the default move after 30 seconds.


4 people like this
Answer
Hi Jo

1 - You can use consumeTurn until Spark.getData().nextPlayer is the player you want.

2- You can set up an event that set's a timer in cloud code to call the default move after 30 seconds.

3- you can use turn based

Thanks
Katie

 

Any answers to the question above? 


hi Katie

how can we do that you mentioned? 2- You can set up an event that set's a timer in cloud code to call the default move after 30 seconds.


The event/countdown will have to be started after  the ChallengeEvent: challenge.takeTurn(playerID)


And on complete of the timeout of the event the:

 challenge.consumeTurn(skipPlayer);


But how should the event be configured in the gmaesparks panel? And prob give an example for the cloud code on the event timeout.




Login to post a comment