Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-1
Question by jesser1981 · Dec 19, 2013 at 12:20 AM · javascripterrorarraylist

BCE0005: Unknown identifier: 'Arraylist'.

I'm brand new to scripting and coding overall. I am following a js tutorial book that is having me script for a card matching game. I've had plenty of errors and managed to work most of them out alone and with some help. Currently I have this new error.

Assets/Scripts/GameScript.js(23,29): BCE0005: Unknown identifier: 'Arraylist'.

This is my code

     //#pragma strict
      
     var cols : int = 4; // the number of the columns in the card grid
     var rows : int = 4; // the number of rows in the card grid
     var totalCards : int = cols * rows; //
     var matchesNeededToWin : int = totalCards * .5; //If there are 16, 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; // store all the cards created in this array
     var aGrid : Array; //Array will keep track of the shuffled, dealt cards
     var aCardsFlipped : ArrayList; //This array stores the two cards that the player flips over
     var playerCanClick : boolean; //to determine when player can click or not
     var playerHasWon : boolean = false; // store wether or not the players has won, start as false.
 
     function Start ()
     {
         //sets up the play area
         playerCanClick = true; // allows player to click on cards
         //initialize the arrays as empty lists:
         aCards = new Array ();
         aGrid = new Array ();
         aCardsFlipped = new Arraylist ();
         for (i = 0; i < rows; i++) //creates iterative loop to place rows on grid incrementally
      
      
     aGrid [i] = new Array (); //Create a new, empty array at index i
     for (j=0; j < cols; j++) //creates iterative loop to place cols on grid incrementally
         {
         aGrid [i][j] = new Card (); //places new cards in the play grid
         }
     }
     function OnGUI ()
         {
         GUILayout.BeginArea (Rect(0,0,Screen.width,Screen.height));
         BuildGrid();
         GUILayer.EndArea ();
         print ("building grid!");
         }
      
     class Card extends System.Object
     {
     var isFaceUp : boolean = false;
     var isMatched : boolean = false;
     var img : String = "robot";
     }
      
         function Card()
         {
          
         img = "robot";
         }
     
      
     function BuildGrid ()
     {
     GUILayout.BeginVertical (); //begin building play area placing cards vertically
     for (i =0; i < rows; i++) //places cards incrementally until reaching 4
         {
         GUILayout.BeginHorizantal (); //begin placing cards horizantally
         for (j = 0; j<cols; j++) // places cards in cols horizantlly until reaching 4
             {
             var card : Object = aGrid[i][j];
             if (GUILayout.Button(Resources.Load(card.img), GUILayout.Width(cardW)))
                 {
                 Debug.Log (card.img);
                 }
             }
             GUILayout.EndHorizontal ();
         }
         GUILayout.EndVertical ();
     }

Any help would be greatly appreciated!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Kiloblargh · Dec 19, 2013 at 12:20 AM

Capital L.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Talavang · Mar 30, 2014 at 03:36 AM 0
Share

LOL... thanks... shame on me

avatar image
0

Answer by jesser1981 · Dec 19, 2013 at 01:10 AM

Thank you, that fixed that error but now I have this error and I have no clue what it means.

Assets/Scripts/GameScript.js(30,28): BCE0126: It is not possible to evaluate an expression of type 'void'.

Here is the code

     //#pragma strict
      
     var cols : int = 4; // the number of the columns in the card grid
     var rows : int = 4; // the number of rows in the card grid
     var totalCards : int = cols * rows; //
     var matchesNeededToWin : int = totalCards * .5; //If there are 16, 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; // store all the cards created in this array
     var aGrid : Array; //Array will keep track of the shuffled, dealt cards
     var aCardsFlipped : ArrayList; //This array stores the two cards that the player flips over
     var playerCanClick : boolean; //to determine when player can click or not
     var playerHasWon : boolean = false; // store wether or not the players has won, start as false.
 
     function Start ()
     {
         //sets up the play area
         playerCanClick = true; // allows player to click on cards
         //initialize the arrays as empty lists:
         aCards = new Array ();
         aGrid = new Array ();
         aCardsFlipped = new ArrayList ();
         for (i = 0; i < rows; i++) //creates iterative loop to place rows on grid incrementally
      
      
     aGrid [i] = new Array (); //Create a new, empty array at index i
     for (j=0; j < cols; j++) //creates iterative loop to place cols on grid incrementally
         {
         aGrid [i][j] = new Card (); //places new cards in the play grid
         }
     }
     function OnGUI ()
         {
         GUILayout.BeginArea (Rect(0,0,Screen.width,Screen.height));
         BuildGrid();
         GUILayer.EndArea ();
         print ("building grid!");
         }
      
     class Card extends System.Object
     {
     var isFaceUp : boolean = false;
     var isMatched : boolean = false;
     var img : String = "robot";
     }
      
         function Card()
         {
          
         img = "robot";
         }
     
      
     function BuildGrid ()
     {
     GUILayout.BeginVertical (); //begin building play area placing cards vertically
     for (i =0; i < rows; i++) //places cards incrementally until reaching 4
         {
         GUILayout.BeginHorizantal (); //begin placing cards horizantally
         for (j = 0; j<cols; j++) // places cards in cols horizantlly until reaching 4
             {
             var card : Object = aGrid[i][j];
             if (GUILayout.Button(Resources.Load(card.img), GUILayout.Width(cardW)))
                 {
                 Debug.Log (card.img);
                 }
             }
             GUILayout.EndHorizontal ();
         }
         GUILayout.EndVertical ();
     }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Issue with OnTriggerEnter. 1 Answer

expecting (, found 'Update' and unexpected char: 0x200B. 2 Answers

Player not taking any damage 2 Answers

Texture2d[]: Array index is out of rang (Javascript) 3 Answers

Making a pick up item that is timed, that moves,scales and rotates 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges