Game Development Community

Do behaviors work on tiles?

by Dave Calabrese · in Torque Game Builder · 03/18/2008 (11:32 pm) · 3 replies

Is there any way to apply a behavior to an individual tile? I have tiles in my game world that I want to damage the player whenever they collide with them, however I haven't had much luck yet in making this work. Possibly behaviors are where I should be looking?

#1
03/31/2008 (8:29 pm)
I only know that you can get the x,y position of the tile being collided so you probably could implement behaviors to handle a single cell. But in some cases it would be much simpler to directly apply them to single cells.

Anyone knows the answer the his question?
#2
04/01/2008 (10:15 am)
Just looking in the editor, you can attach behaviors to tile layers but it doesn't look like you can attach behaviors to individual tiles. The feature tutorial on tile maps in the TGB docs suggests using the tile's custom data properties to implement something like damage when a player collides with it.
#3
04/01/2008 (11:22 am)
An individual tile cannot have a behavior, because it is not its own t2dSceneObject. Tiles only exist 'inside' a t2dTileLayer, so if you want to use behaviors, you would want to attach behaviors to the tileLayer.