Hi all,
I’m fairly new to oop, I’m following this book, we’re making a memory card game, and when I type out all the code, I get that error, I read some other answers and they said that you’d have to remove the #pragma strict from your code which I did, and the problem continues. Any help is appreciated. Problem rests at line 30 apparently.
var cols:int;
var rows:int;
var totalCards:int=16;
var matchesNeededToWin=totalCards*0.5;
var matchesMade:int=0;
var cardW:int=100;
var cardH:int=100;
var aCards:Array;
var aGrid:Array;
var aCardsFlipped:ArrayList;
var playerCanClick:boolean;
var playerHasWon:boolean=false;
var i:int;
var j:int;
function Start()
{
playerCanClick = true;
aCards = new Array();
aGrid = new Array();
aCardsFlipped = new ArrayList();
for(i=0; i<rows; i++)
{
aGrid *= new Array();*
for(j=0; j<cols; j++)
{
aGrid*[j] = new Card();*
}
}
}
class Card extends System.Object
{
var isFaceUp:boolean = false;
var isMatched:boolean = false;
var img:String;
function Card()
{
img = “robot”;
}
}