September 2011
Beginner
408 pages
9h 52m
English
The strategy we'll use to build our deck is to create an array of possibilities, randomly choose one of those possibilities, and then remove that possibility as an option. Let's see how that works.
BuildDeck function, start off by declaring a few variables:function BuildDeck() { var totalRobots:int = 4; // we've got four robots towork with var card:Object; // this stores a reference to a card }
var card:Object; // this stores a reference to a card
for(i=0; i<totalRobots; i++)
{
}This loop will run four times because totalRobots is set to 4. Next, create an array called RobotParts that will house the names of the body parts ...
Read now
Unlock full access