September 2011
Beginner
408 pages
9h 52m
English
Let's set up a deck-building function called BuildDeck.
BuildDeck. Write this function outside of and apart from your other functions—make sure it's not trapped inside the curly brackets of one of your other functions.function BuildDeck() { }
BuildDeck function in the Start function, just after you define the three card-related arrays:function Start()
{
playerCanClick = true; // We should let the player play,
don't you think?
// Initialize the arrays:
aCards = new Array();
aGrid = new Array();
aCardsFlipped = new ArrayList();
BuildDeck();
// (the rest of this function has been omitted)
}The very first function that gets called in our script is the Start function. ...
Read now
Unlock full access