Torque2D, Class vs Datablock
- by Max Kielland
I'm scripting my first game with Torque2D and have not fully understood the difference between "Class" and Datablock.
To me it seems like Datablock is similar to a struct in C/C++ or a Record in Pascal. If I create Datablocks with new, are they instantiated in the same way as a "Class"?
I have a large TileMap and need to attach some information to each Tile. I was thinking to use a Datablock, as a struct, to attach this information to the tile's CustomData property.
The two questions are: What is a Datablock and should I use a Datablock or a "Class" for this tile information?