- Home /
Question is off-topic or not relevant - code not readable
Can't get rid of errors
I have been over this 1000 times. please help. thank you
pragma strict
var cols:int = 4; // the number of columns in the card grid var rows:int = 4; // the number of rows in the card grid var totalCards:int = 16; var matchesNeededToWin:int = totalCards 0.5; / If there are 16 cards, the player needs to find 8 matches to clear the board / var matchesMade:int = 0; // At the outset, the player has not made any matches var cardW:int = 100; // Each card's width and height is 100 pixels var cardH:int = 100; var aCards:Array; // We'll store all the cards we create in this array var aGrid:Array; / This array will keep track of the shuffled, dealt cards */ var aCardsFlipped:ArrayList; /This array will store the two cards that the player flips over /
var playerCanClick:boolean; / We'll use this flag to prevent the player from clicking buttons when we don't want him to / var playerHasWon:boolean = false; / Store whether or not the player has won. This should probably start out false :) /
function Start () { playerCanClick = true; // We should let the player play, don't you think? // Initialize the arrays as empty lists: aCards = new Array(); aGrid = new Array(); aCardsFlipped = new ArrayList();
for(int i=0; i
Follow this Question
Related Questions
Destroy Other 2 Answers
Console Error 1 Answer
A node in a childnode? 1 Answer
Boo: Object reference not set to an instance of an object 1 Answer
Unity Script Editor Not Working 1 Answer