Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualprototypical

Posted 24 August 2012 - 02:44 PM

I'm not sure that I am completely understanding what you are trying to do, specifically in regards to a 2D Array.

Just create an GameObject class or object and push that into the single dimensional array.

for example :

var item:Object = {id:124, name:"axe"}
inventory.push(item);

** using the squiggly braces "{}" is shorthand for creating a new object.



I used an object, but I'd think that you'd want to have a class for all game/inventory objects that would include any information about that object.

#1prototypical

Posted 24 August 2012 - 02:43 PM

I'm not sure that I am completely understanding what you are trying to do, specifically in regards to a 2D Array.

Just create an GameObject class or object and push that into the single dimensional array.

for example :

var item:Object = {id:124, name:"axe"}
inventory.push(item);


I used an object, but I'd think that you'd want to have a class for all game/inventory objects that would include any information about that object.

PARTNERS