How to implement delay in the method flow?

In typescript MatchLoop when the game starts I want to initialize the game in this flow.
→ Create game instance
→ Create Deck
→ // wait for 500ms
→ Shuffle Deck
→ // wait for 500ms
→ Distribute cards

I want to add delay between each in typescript. Not sure whats the correct approach. Please share some ideas

Hello @Sathyaraj,

With the match tick rate and the current tick within the match loop you can calculate elapsed time and with it introduce some delay by idling the loop for some amount of ticks.

You can see a few examples in the project template where this is used to allow a player to re-connect or to introduce a time limit for each move.

Hope this helps.

1 Like