I'm going to make a tile-based 3D RPG game in Flash AS3 with Away3D API.
my problem is that i dont really understand the away3d api so far..
I want to make a "blocks" class. if i load the tile-map-data, i want to make something like this:
viewport.addchild( tileArray[ layer ][ x ][ y ] );
so this would be in a loop.
so far so good, but this would have to be a 3dObject.
to fill that array with that 3dObject i want to make something like this.
tileArray[ layer ][ x ][ y ] = myBlocksClass.getBlock( "grassCube" );
so the getBlock functon in myBlocksClass sould return me a 3dObject.
<edit>
those blocks should be some sort of blocks like in minecraft ( grassCube, dirtCube,... ) so i want to load multiple instances of one block in a map
</edit>
how can i do this ? does anyone can give me any idea or maybe a reference ?
and YES i've allready looked in all awaylable resources / documentarys / examples, but i could't figute it out anyway.
UPDATE:
the question is more to code. i know the theory, but actionscript3 for game dev is nearly new to me.
how to structure the class for the "blocks" ?