Type Question
Blitz3D Forums/Blitz3D Beginners Area/Type Question
| ||
I've used Types before, but I've never really tried to understand what's happening. It seems that once you define a Type, and create a new object out of it, it's placed into a global "stack" like structure. From there that stack can be cycled through. So now to the question. Is there a way to split that stack into two parts? Like, blocks in the "well" for Tetris, and blocks for the falling shape? EDIT: Or better yet, is there a way to have an array of types? |
| ||
The only way is to use a field within your type to determine what the object is. Either that or have two separate types. |
| ||
Okay, thanks |
| ||
Yes, there is a way to have an array of types. I'm not quite sure how to do it, but I remember in Krylar's book about BlitzBasic, it demonstrated how to do arrays of types, arrays within types, and types within types! |
| ||
Array of types ..Type MyType field x#, y#, z# end type Dim MyArray.MyType( 1, 10 ) MyArray( 0, 0 ) = new MyType MyArray( 0, 0 )\x = 10 etc.... Stevie |
| ||
Aha! Thanks! |