Game Development Community

Layers in a game?

by Jon Mitchell · in Torque Game Builder · 09/04/2007 (8:54 am) · 3 replies

Has anyone done this, or know if it is possible to use layers in a game?

For example say you have a game with two layers, one being the surface of the water and the other being below the surface. The layers would interact with each other, if you released a bubble below the surface, an object on the surface would not see you, but would see your bubble as it broke on the surface. Or if you tossed a stone on the surface, the person below the surface would not see you, but would see the stone sink past them.

#1
09/04/2007 (9:13 am)
The Scenegraph does have layers, and sceneobjects can be assigned to different layers. This affects primarily rendering order, and it is covered in a number of the included tutorials, specifically I think the shooter/feature tutorial, where you have a scrolling background which consists of multiple layers. You should also check out sort points and the different sorting options you can assign to a layer. (This determines in which order objects in the same layer are drawn) Also something to check out, the adventure kit makes use of layers and sortpoints to achieve an isometric view.
#2
09/04/2007 (10:09 am)
The layers interaction could be be done in script if you have the ability to hide a layer. Not sure if you can but if so you could hide the layers above the player, and script the interaction between them.
#3
09/04/2007 (10:49 am)
I was just thinking that Tom after, reading what James said. It seems like you should be able to take a group of objects that reside in a layer and toggle their visible state, if not I guess it could be done by using their class name.

James, thanks for the tip on the Adventure kit! :-)