I'm trying to create a hearthstone style of handling turns.
Basically, the game is turn-based but with a time limit on how long a turn can take. A user get's say, 45 seconds to until the timer ends their turn. They can also force complete which activates the other players turn.
Illustrated below.
I tried using the SparkScheduler but it doesnt seem to work when being called from a module that was called from SparkScheduler. Is there any way around this to make this style of game?
Best Answer
C
Customer Support
said
over 6 years ago
Hi One More Turn,
You could use the User ChallengeTurnTakenMessage Cloud Code to trigger the 45 second scheduled timer as one of these is sent when a turn is taken, at the end of which you can use SparkChallenge to consume the players turn ("Spark.getChallenge(mychallengeid).consumeTurn(playerId);") and pass it to the the player. If the turn is submitted within the 45 second time frame, cancel the scheduler. Does that make sense ? Let me know if you have any further questions.
You could use the User ChallengeTurnTakenMessage Cloud Code to trigger the 45 second scheduled timer as one of these is sent when a turn is taken, at the end of which you can use SparkChallenge to consume the players turn ("Spark.getChallenge(mychallengeid).consumeTurn(playerId);") and pass it to the the player. If the turn is submitted within the 45 second time frame, cancel the scheduler. Does that make sense ? Let me know if you have any further questions.
Thanks,
Liam
O
One More Turn
said
over 6 years ago
Would using consumeTurn free up the scheduler limit?
One More Turn
I'm trying to create a hearthstone style of handling turns.
Basically, the game is turn-based but with a time limit on how long a turn can take. A user get's say, 45 seconds to until the timer ends their turn. They can also force complete which activates the other players turn.
Illustrated below.
I tried using the SparkScheduler but it doesnt seem to work when being called from a module that was called from SparkScheduler. Is there any way around this to make this style of game?
Hi One More Turn,
You could use the User ChallengeTurnTakenMessage Cloud Code to trigger the 45 second scheduled timer as one of these is sent when a turn is taken, at the end of which you can use SparkChallenge to consume the players turn ("Spark.getChallenge(mychallengeid).consumeTurn(playerId);") and pass it to the the player. If the turn is submitted within the 45 second time frame, cancel the scheduler. Does that make sense ? Let me know if you have any further questions.
Thanks,
Liam
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by PopularCustomer Support
Hi One More Turn,
You could use the User ChallengeTurnTakenMessage Cloud Code to trigger the 45 second scheduled timer as one of these is sent when a turn is taken, at the end of which you can use SparkChallenge to consume the players turn ("Spark.getChallenge(mychallengeid).consumeTurn(playerId);") and pass it to the the player. If the turn is submitted within the 45 second time frame, cancel the scheduler. Does that make sense ? Let me know if you have any further questions.
Thanks,
Liam
One More Turn
Would using consumeTurn free up the scheduler limit?
Eric William
Could you post some examples?
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics