Intelligent System – 5

For this week, I decided to create the data structures that are needed for the game. Since this is a congklak game, I created the data based on what is in the game.

This is the congklak data, which contains the data of the hole in the congklak board. Each hole contains another data such as the x, y coordinate and the amount of congklak seed. So basically it is a data inside another data. For example index 1 indicates the first small hole and inside it is located in the coordinate x = 130 and y = 160 and it also stored 5 congklak seeds.

There are 3 game modes in this project. The first one is single player which lets you play against an AI, the second one is multi where it is player vs player and the third one is AI vs AI. This is the data that is stored in each game modes. Inside the p1/p2, the indexes represents the current player who are playing the game and also the AI that is used.

This code creates the sprites for the hole in the congklak board, it also calls the data that is stored in the congklak data that i explained earlier. After that, I put all of them into an array of data so it can be easily called based on the index. I also group them so I can blit the sprites all at once.

Leave a Reply

Your email address will not be published. Required fields are marked *