Thank you for visiting Blazing Games

A Generic Dice Holder

(9:30-11:30)

The dice container class has the goal of being able to display an unknown number of dice with the dice being as big as possible. This is a very important thing to have for the Pig game as the number of times the player rolls is variable as the player is allowed to keep rolling until they wish to stop or they roll a one. The only real issues involved are how to add dice and how to do the layout.

There are two potential ways to add dice to the container. The first would be to take an existing dice ojbect and add it. The second way is to just add the roll number and create a new die. The Flash player only allows a display object to be in one display list at a time so I opted to create a new die.

Laying out the dice was actually the tricky part. It was done in two steps. The first step figured out how many rows would be needed to hold all of the dice. The second step then positions all of the dice based on how many rows there are. Of course, we need a title to show the container. Instead of start and about buttons, the title screen buttons add dice and clears the container.


Previous page
Making Pig Page 3

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