PDA

View Full Version : Help Please! Masking tiles in a rpg game



Discipol
October 30th, 2007, 05:52 PM
hello. I have made an rpg game much like muonline or our dear old friend diablo2.:link: but i have a problem.


I made a class called MySWF.

Inside of it I load a swf with the animation and then I generate a Shape to mask the rectangle swf in order to hide the corners (will look like a game-car diamond oh its belly).

i make about 20*20 instances in a empty mc then move the mc with the keyboard. now, all the instances move corectly but, for some reason, the masks don't move and as you may immagine, you can see the picture as it moves below the mask... This shouldn't happen...

I put the instances in a mc so that i do mc.x += 10 so all the instances of MySWF move and i DONT have to use a "for" ...for each of them.:cantlook:

please help i cant find anything on the net about it...

Discipol
October 31st, 2007, 10:50 AM
is it the same thing to do a for(i in instances) and there instruct the swf and the mask to move OR to put the instances in a big container like I am trying to do? optimisation and low memory consumption is an important aspect

efnx
October 31st, 2007, 12:02 PM
Can you show us an example?

Discipol
October 31st, 2007, 12:07 PM
you mean a screenshot or the source? i really can't show it since its a big project and the people who work on it...copyright things:trout:

but the problem is simple. when i am moving an OBJECT, the SWF inside it and the mask inside the OBJECT should move, but the mask doesn't.

strange that if i move the SWF and the mask using a method *not moving the OBJECT but its contents inside of it* it works nicely; logical that this affects performance. putting them all in a container and moving the container seems much more cleaner:hugegrin: