I'm having trouble with this for a while now and been trying for months.
I need to get Flash to know what Map I am on (tile based game) for triggering different events on one selected tile by walking on it depending on what Map I am on. I am using an array for the Maps.
How I set up my tiles like this and the pictures of the tiles are all in one clip but maps are bigger.
These are some of my failed attempts.PHP Code:Map1=[[1, 1, 1],
[1, 0, 1],
[1, 1, 1]];
game.Tile1 = function () { };
game.Tile1.prototype.frame = 2;
PHP Code:if(_root.mc.char.hitTest("Map1"[i])) {
//code
}
{
Even tried linking my maps into other array.PHP Code:if("Map1") {
//code
}
{
PHP Code:Map1=[1, 1, 1];
Map2=[2, 2, 2];
ArrayLink=[Map1, Map2];
PHP Code:if (_root["Map"+game.currentMap] = Map1){
//code
}
Even pointing me in the right direction that would be great.PHP Code:for (i=0; i < Map1.length; i++){
//code
}




Reply With Quote