Game Development Community

How to call a script when colliding with a tile?

by Dave Calabrese · in Torque Game Builder · 03/16/2008 (8:14 pm) · 4 replies

Is there any way to make a script or flag get set when colliding with certain tiles? Such as if I wanted the player to get injured when touching certain tiles, or if I wanted the touching of a tile to trigger an event. Any thoughts on how to accomplish this? It seems like there is a 'Tile Script' property, but I can't find anything about how to define these...

#1
03/31/2008 (3:47 pm)
The docs aren't real clear on how TGB individual tile scripting works. I'd recommend using t2dSceneObjects or t2dTriggers instead of relying on tiles, but if anyone has a better idea, I'd more than love to hear it.
#2
04/01/2008 (7:37 pm)
I'd think you would want to use the tile custom data to define whether it is a tile that, for example, injures the player. In the players oncollision you can can always poll the custom data of the hit tile and then act on that. You can see my Breakout tutorial for examples of this.

The Breakout Tutorial

Greg
#3
04/01/2008 (7:54 pm)
It seems to me like that question was already answered for you in this thread:
www.garagegames.com/mg/forums/result.thread.php?qt=63625

Did you still have a remaining question?
#4
04/02/2008 (4:06 am)
Cool, Greg! That makes me want to do your tutorials even more!