Thank you for visiting Blazing Games

Single player game

(13:30-16:00)

My break was longer than I planned. Hopefully it won't mess me up too much. Now comes the important part. Getting the game working. Rolling the dice is simple enough but determining if the roll has left the player with a valid play is kind of tricky. After playing around with this problem, I use a brute force method and then I realize that my brute force method is overkill so I simplify it.

Instead of testing every combination of two to see if they are available and add up to the target value, I only need to loop through the numbers 1 through half the target value. The loop counter is subtracted from the target number and that determines the two numbers that need to be combined. A simple check to see if the combination is possible is done and if it is done then we know the game is not over. If there are no possible combinations then the game is over for the player.

Previous page
Making Shut the Box Page 5

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2008 Blazing Games Inc. All Rights Reserved