Board games in the game engine

Hi.

I’ve been learning Blender recently, and decided to try and model a few board games and make them playable in Blender’s game engine. I’ve had success with turns and general movement, but I’m having trouble with the “jump” concept of checkers. I use ray sensors to determine whether or not there are objects next to the selected piece. However, in a situation like this:

R__
B
__B

The red checker uses ray sensors to find that there is an enemy next to it, but has no way of telling whether or not the square behind it is empty or full. This is my problem.

I have a python script that I found in a tutorial to make the mouse visible, and am clicking on destination tiles to move to them.

I’m trying to use mostly data blocks, but I am willing to dip into python if necessary.

Any help is appreciated.

EDIT: here’s the blend. I finished the rest of my checkers game, but I didn’t really fix the problem that was this thread…

Attachments

AlmostCheckers.blend (819 KB)

maybe using more rays? or repeating the check several times until you find a blank space

More rays doesn’t help, since both black checkers have the same materials/properties. The ray just hits the first checker along the path and then stops.

I suppose I didn’t say it this way: the rays are coming from the checker that is selected.

Personally, i would set up an 8x8 matrix in python (assuming that’s the size of your board) and have that hold all the information, eliminating the use of copious messy rays.