See, I have a board game with a 2D array acting as the board. There are number in the 2D array, and should a number be placed (by the player) in a spot in the 2D array where a number already resides, the following can happen:
> If the residing number is higher, the invading number is 'killed'.
> If the residing number is lower, it is killed and the invading number takes its place.
> If they are both of the same value, both are killed.
But I can see problems with this approach (players, for example). After doing some research, I found out that other programmers use classes for the pieces.
I'm no expert in classes. I've only used them to store and get values, as well as to perform minor changes to stored data.
How do I go about using a class as a piece? And how do I set said class / piece on the 2D array?
From what I know, it would seem as if I would make 14 classes (1 for each unique piece) and each class would have 2 values - the rank, and the alignment (player 1 or 2). And then I am to, somehow, put this in a 2D array?
Sorry for such a noobish question. Thanks in advanced for those who answered.