Asynchronous Programming + QoL


The first major change is that bots now have a time delay of 300ms between moves to avoid obliterating your eardrums when they play a 200 move abomination in a single frame, unleashing every single sound effect at once. This is done using promises, async and await. This makes it possible to flag the bots and keeps the game running while the bot is thinking, which will be useful for when the move selection algorithm becomes more complex.

The other major change is detection for when the game is over. I made a UI that will display the result, and the reason for it (e.g. Checkmate, Stalemate, etc). Wins are highlighted in green, losses in red and draws in grey. 

One more thing, I added the ability to generate random Chess960 positions, so that game mode could be played, if it weren't for the fact that castling in Chess960 is currently completely broken and will be fixed in a future update.

I also moved the copy and undo key binds from a single key to Ctrl+C and Ctrl+Z respectively.

Next update will include the second bot!

Files

asynchronous.zip Play in browser
60 days ago

Leave a comment

Log in with itch.io to leave a comment.