
I’ve been working on this game for a little while and I got stock here.
Does anyone know if there is a way to detect if a movie clip is surounded by other movie clips as it shows in the above picture.
You can look at the game at this url:
Cathedral Game
hope somebody can help me.
John Tubert
Have you tried hit testing those coordinates?
The gray piece in the middle(the cathedral) is surrounded by many pieces(red ones). The may be touching the cathedral or they may not, but if they are surrounding it the cathedral should dissapear.
any ideas???
thanks
JT
Yup, see you can hit test coordinates. Your cathedral has 5 blocks that can touch red. There are 18 possible positions for surrounding red blocks. You can hit-test all of these coordinates pretty easily.
See what I mean? Like, cathedralMC would test (x,y):
(0,25);(10,25);(10,15);(20,15);…etc.
yes but there are many posibilities…the red boxes could be touching the cathedral or they could be far away and still surrounding the cathedral. How do I test that??
Somebody suggested pathfinding algorithms…I’m taking a look at that.
thanks
JT
Ah, I see, I’m gonna have to think about that one.