MikeW Posted February 26, 2017 Report Share Posted February 26, 2017 I am writing a turn based game (think risk - it's not risk but it's a good analogy for how turns work). Multiple players work great, AI works except the turn is instant. so one human player against 5 AI's. Player goes and in a blink all five AI's have gone. Been searching and come up blank. I want to call a routine that moves the AI then in maybe a second continues the loop. Quote Link to comment Share on other sites More sharing options...
drhayes Posted February 27, 2017 Report Share Posted February 27, 2017 I don't know how your AI knows that it's the AI's turn, but you could put a timer on that function instead of calling it directly. Check out Phaser.Timer. There's a pretty good timer available at "game.time.events". You can do something like "game.time.events.add(5000, this.takeAITurn, this);". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.