Hello! I’m trying to make a chess game.
However, I’m not familiar with what is usually needed to make a chess engine. Is there a specific framework I have to follow and what other knowledge do I need to learn?
Thank you for your time!
Hello! I’m trying to make a chess game.
However, I’m not familiar with what is usually needed to make a chess engine. Is there a specific framework I have to follow and what other knowledge do I need to learn?
Thank you for your time!
There are a few means of doing this.
One I tried was making a 8 by 8 table {8,8} and moving the pieces within it.
Each of the pieces had a list of moves, so when a pieces is selected it would be found in the table and then its moves would be calculated.
The pieces stored the way they moved in table format for example a pawn was {0,1} or {0,2} on first move with {1,1} {-1,1} for taking pieces.
Thank you for the advice!
What would you do to pinpoint the location of pieces? For example, if I clicked a pawn, how would the script register it’s the position.
You can try generating a grid and detecting if the pawn is touching a grid.
Building on your idea, I think I can generate the grids and place them in a 2D array. Then for each of the grids, I can store a chess piece.
So when the client fires the chess piece, the server just needs to find the piece in the array which will determine its position. Not sure if this works however.
You can put the chess piece into the table. Simples
Also if ur making a proper chess game and it turns out alright hit me up and ill give you some ideas.
I think this is an actual opportunity to make use of an object oriented approach to programming. You can have a class for a generic chess piece and then make specialised classes for each type of piece. These would have attributes like position, colour, a move function etc
Yep, I’m aiming for it to use OOP only.
Of course, I’ll let you know when I finished a prototype!