Replies To: FLASH: hitTest, creating more than one wall.

Re: FLASH: hitTest, creating more than one wall.

There are many ways to make this work out, you may want to look at google for "console games" there is one that shows how to make an interestin console type game in flash.

One way that you may want to think about doing things, assuming that you don't have millions of different pieces of terrain on the screen at once (or checking at the same time) would be to add all of them to an array and just loop through them.

That will check for everything you add into the terrain and see if every check hits it, if it does it will end the loop and continue the checks, other wise it will continue the loop until it finds one that works, or finishes going through the array of movieclips.

However, a better way, is to simply place all the ground that you want in a single movieclip and then to a hitTest against it.

Here is some sample code from a console game out there in one of those tutorials: