Hi, thanks for trying the game, I was beginning to think noone would reply.
All your suggestions are good, and i will try to implement most of those things. I already thought about most of these things, but decided to save them for last (except for the castle move, didn't know about that).
Adding the AI was pretty hard, but not because of the AI itself, but more because i was having issues saving everything and then restoring everything after the algorithm did its thing.
It's a quite simple algorithm though. I just put values to the chess pieces: 1-3-3-5-9-1000, and then i check every possible move that can be done by the computer, then every possible counter move the player can make, and then i check every move the computer can make again to respond.
It then checks which moves that makes the computer have the biggest point advantage compared to the player, and to add some unpredictabilty, it picks one of these moves at random, if there are several moves with the same point gain (this is why the king just moved out in the start for you, all moves would give 0 point differance between computer and you, you weren't close enough for him to see what would happen yet so he picked a random move).
Doing it this brute force way is not optimal because i can't check very far ahead in the game until it takes too long for the computer to respond. There are ways to make it more efficient though. Currently the computer has to loop about 70 000 times to calculate a response. If i wanted to check 5 moves ahead instead of checking 3 moves ahead, it would have to loop 100 million times (if we are in a situation where each player can make 40 different moves, but if it's higher, like 50 moves, then it would be 300 million and so on).
I will look into making the algorithm more efficient, and i will implement some of your suggestions, thanks again for taking some time to trying it out and giving me feedback
.