10 December 2009

Changing the rules

I played a few games and realised I wanted to change the rules. Instead of capturing the opponents pieces you can send them back to their start square. This improves the game play enormously, but does mean that the weightings I generated earlier are all invalid.

08 December 2009

XNA game

I hooked up the existing code to generate the computer's move and make it.

There are still no delays yet, so after your turn the dice get rolled and the move is made instantly, then the dice are rolled again instantly and it's your turn. I need to think of a way to introduce a delay, possibly even an animation to move the pieces smoothly and give the human player a chance to appreciate what is happening.

07 December 2009

Highlighting moves

I added highlighting to show the square you are hovering over and the square the piece would move to with the current dice. To do this I am using PNG files with transparent backgrounds as follows

Background



Piece



Highlight



Put it all together



and for the destination cell

Background + Highlight


These only show up if there is a legal move for the piece hovered over using the current dice.

To display them I am adding them to a spriteBatch:

// start collecting sprites
spriteBatch.Begin();
...// where to display the sprite
Vector2 tempVector = new Vector2(x, y);
// display piece (a Texture2D)
spriteBatch.Draw(piece, tempVector, Color.White);
...
// finished collecting sprites
spriteBatch.End();

That's all it takes to display a 2D board game, lots of sprites displayed in the right place. Not too difficult.