shieldsduncan
03-30-2003, 10:48 AM
Hi, I'm building a tyle based engine and I want to be able to do a hitTest dependant on which tile I am in at any give time.
The tile names are each called:
_level0.grid.celli_j
Where i is the column number and j is the row number.
eg
000{}00
0000000
0000000
This tyle ({}) would be called cell4_1
I have variables set to tell me which cell my character is in at any given time and I need to know how to write the script which would do a hitTest whilst he is in it without having to write a different line of code for each tile.
What I need is the syntax to do this:
if (character.hitTest(celli_j.objectName)){
do something;
}
Any help would be great,
Cheers
The tile names are each called:
_level0.grid.celli_j
Where i is the column number and j is the row number.
eg
000{}00
0000000
0000000
This tyle ({}) would be called cell4_1
I have variables set to tell me which cell my character is in at any given time and I need to know how to write the script which would do a hitTest whilst he is in it without having to write a different line of code for each tile.
What I need is the syntax to do this:
if (character.hitTest(celli_j.objectName)){
do something;
}
Any help would be great,
Cheers