Game Development Community

Datablocks Useage 1.3.1

by Jason Darby · in iTorque 2D · 04/20/2010 (5:17 am) · 2 replies


Just wanted to clarify something about datablocks.

Ok in 1.2 when we had a initial loading screen at the start of the app, we would load all of the datablocks. This meant the game was ok speed wise.

Now the datablocks get called when the different scenes are displayed automatically... leading to a 2 second delay as the screen loads in.

Can i tell iTGB to ignore the datablocks in the datablocks folder for different scenes? Can i call the datablocks still at the start of my app (would they still get called as the scene is accessed)?

All it says in the docs is that the datablocks are called, is there any further information into actually how to use/call them?

Any advice would be appreciated.

About the author

Computer games book author, have written 6 game creation books, published by Cengage Course Technology. Owner of Arcade website www.madword.com and Castle software.


#1
04/20/2010 (6:24 am)
Hi Jason, It will only load the datablocks for the level if it is named <levelname>_datablocks.cs. You can name them whatever and load them when you want them loaded using an exec("~/game/data/levels/datablocks/mydatablock.cs"). In my app I load all the main stuff at the start and then have separate datablocks for each specific level which I load when showing between game scene.
#2
04/20/2010 (9:47 am)
Ah excellent, thanks Scott.

That makes perfect sense.. :)