Game Development Community

Assigning a tile a name...?

by Paul Davis · in Torque Game Builder · 11/06/2007 (11:26 am) · 3 replies

Ok, I've looked everywhere and found nothing, my question is:
how can you test when you've collided with a specific tile?

and how do you name individual tiles?,

Thanks,

P

#1
11/06/2007 (12:19 pm)
You can't really name them, but tiles do have a "customData" field, which you can put anything in you want. Look closely in the editor when you are editing a tile layer; you can set it there.

When you collide with a tile the tile coords should be passed into oncollision as a parameter. Although I personally had some difficulty getting this working.

%data = %layer.getTileCustomData( %coords );

Then test the value of %data and do whatever appropriate.
#2
11/06/2007 (9:02 pm)
So i'd type

name=coltype;

into the customdata rollout?

Ok, thanks James,

P
#3
11/07/2007 (8:19 am)
No, just type coltype.