Checkers game with basic AI in J2ME

I bought a pretty awesome book called “Artificial Intelligence for Games” by Ian Millington and thought that it would be fun to make a simple checkers game for J2ME using the negascout algorithm that the book teaches.

As always I had a lot of fun designing the UI and I made a checkers board and pieces using 3D Studio Max which were then edited into a spritesheet using Photoshop. Here are a few screenshots from the game:

Screenshots of game

From the main menu you can choose between starting as the black or red counter. You can select player versus cpu or player versus player.

Here is a recording of a playthrough where I play against the “Novice” difficulty CPU. The counter movement animations are rendered much more smoothly on my phone than in the following animated GIF:

Animation showing Human vs CPU

Disclaimer - I am pretty bad at playing checkers!

Each player is an instance of either a human or computer controlled player class. This makes it easy to switch between different AI algorithms. Initially I had implemented this using the minimax algorithm but then later switched over to the negascout algorithm.

Overview of player classes

The AI seems to behave quite well until there are just a few of the promoted counters remaining and then the game seems to become impossible to win for either player. I am sure that I am probably missing important gameplay strategies!

I designed three different skins for the checkers board and the counters which can be selected from the main menu:

Screenshots of the different skins

This was a fun project; I was able to create something a little more visually interesting than previously with my “Worm” game and even introduced a dash of basic board game AI. More importantly I actually have a hard time beating the AI.