Game Development Community

Confused about datablocks.cs

by Tom Cassiotis · in iTorque 2D · 10/12/2011 (6:09 pm) · 2 replies

I have been working on my game on tgb 1.7.5 and thought tonight would be the night I would install iTGB and start rebuilding it.

So I start a new project, created a sprite then added it in the scene. Go to test it and the sprite is nowhere to be seen.

Kick myself a few times for being such a newb then recheck everything, ran the behaviours tutorial successfully (not a environmental thing). Eventually, I got out of the tgb editor and started poking around.

I figured out that the editor added the datablocks in manageddatablocks.cs instead of datalevelsdatablocksemptyLevel_datablocks.cs. I found the code that loads the "datablocks/" @ %levelFileName @ "_datablocks.cs" and so I moved the datablock definitions from the one file to the other and everything is good.

But can someone tell me if I missed a step, some knowledge, or is this a bug?

The steps I took were intuitive to me, Create Project, Give it a Name, Create Sprite, Add it to the scene. I would imagine that this should just work.

#1
10/12/2011 (7:57 pm)
Once you add any sprite to a scene, what you will need to do is add its datablock to the level_datablock.cs. The easiest way is the datablock button. It looks like a little chain link in the top rightish area of the header btns in the editor. Just click that and it will open a window allowing you to add any datablock from the managed to the level datablock.


#2
10/13/2011 (6:05 am)
Oh that was what Mich was doing on the live video stream. I missed what he was saying as the kids were fighting over some board game. And I didn't get back to it.

Thanks Rennie