Closed tannerkrewson closed 5 years ago
Also disallow "queueing" your next move by clicking the board while the AI is thinking
A loading spinner that represents the AI thinking would be cool; we could reuse the spinning chip
The code we're running doesn't have to mess with the UI, so we could try web workers! https://caniuse.com/#feat=webworkers
done with web workers ✔️✔️✔️
ef3d3ed097005a13c3bb135811ed90d599bfe0a1
So I just added a fade animation to the main menu modal, and now when you click on
AI vs AI
, it gets locked into the grey screen for a second. This is because the AI code process syncronosly and the whole page has to wait for the AI code to execute before being able to process any other JS. The way to fix this would be to do the minimax calculations with callbacks, promises, or async/await.I actually might be able to that outside of the AI itself, as a change to the
XPlayer.js
interface between the code of the player and the code of the game.