I'm trying to get my campfire movie clip to mask over my night shadow movie clip, so it doesn't show the "darkness" of night by erasing that part of the movie clip. It erase's it but not just the size of the movie clip, it erase's all of it :D
I've tried placing it on level instead of in world.worldTiles
and taking it out of the array but it still does the same thing. I've also tried placing it on the world.worldTiles[i]
of the movie clip, still erase's the whole movie clip. I flipped the .mask = night
around and it only shadows over the campfire model.
This is the code I'm using:
public function addWorldObj(obj:MovieClip, c:Class, X:int, Y:int, w:Number, h:Number, f:int)
{
obj = new c();
world.worldTiles.addChild(obj);
obj.x = playerTileCoord.x + X;
obj.y = playerTileCoord.y + Y;
obj.width = w;
obj.height = h;
obj.gotoAndStop(f);
if(obj.Name == "campfire"){
obj.mask = night;
}
world.tilesInWorld.push(obj);
}
The night shadow movieclip is just a giant black square thats alpha gets changed.
The campfire is an invisible square with an overhead campfire drawn inside it, the width and height of the campfire are the size of 1 square, it should be masking 1 square out of the nightShadow movieclip, but it mask all of it.
Here is a link to the game. http://www.fastswf.com/00CRfh4 The game starts out at .75 alpha counting upwards. You can click on the hammer at the bottom right of the screen to open the build menu (You can also click the "E" button which also kills you at the moment for testing purpose's) Once open click the campfire text and place it somewhere on the map and watch it mask away the whole night movieclip! :D