Building a Chess Game in Unity
In this post, I’ll be covering the basics of building a simple chess game in Unity and C#.
The MVP of this project will be a fully playable 3D chess game for two players. Each character will only be able to make moves that comply with the rules. After slaying a king, the game is reset. To improve the game, menu scenes, statistics and a simple AI will be added later. The final project and its source code is available on my GitHub-profile.
Since this article became quite large, I split it into different parts:
- Loading the Assets - for programmers lacking 3d-modeling skills
- Setting up the Scene - to create a basic setting
- Drawing the Chessboard - to make testing easier
- Initializing the Characters - and move them to their default location
- Movement Control - to differentiate between selecting and moving characters
- Board Highlighting - to mark all fields to which can be moved
- Obey the Rules - to implement each characters movesets
Loading the Assets
I think it is quite common that programmers are bad designers. At least that’s the case for me, which is why I try to get the graphic elements for my chess game from the Asset Store. I found Arcane Cyber’s Classic Chess Set to look pretty nice and decided to give it a shot. This asset pack contains three different types of figures (metallic, marble &…