Hi every all!I don't know if i lose my mind or not...Regarding this simple code with 3 overlapping conditions, why at the end of all the text is not set ?

i need to check the 3 sprites (that in my case i used like a cam and in reality are10 sprites) that overlap a map and checking what they are overlapping in order to simulate a dungeon crawler like Dungeon Master)The yellow square is moving over the map and it got 10 image points in order to set the cam sprites (blue circles) to follow the yellow square at the same time.

Hey it's hard to tell from the info you provided, but I'd do two things:1) check the map_wall object, there may be a reason why there is no collision detected2) Instead of nesting the code up to 3 levels (or 10 levels), add an "AND" condition so they all can be checked in the same block

Thank to all! Makotto: i checked all the map_wall sprites and seems they are all ok (i changed the sprites size, i put all the sprite in the same layer too) . Regarding the code i did also the "and" condition setting the overlapping check in the same condition and seems that if i have 3 or more conditions of overlapping the code won't work, with just 2 condition of overlapping it work correctly. (but i need mor than 3....)Dop2000: the link of the demo is in the first post. Regarding the capx i will share it soon because i'm not in home!

I know what's wrong with your code. When you check first if cam_lontana_sw is overlapping map_wall, you pick 1 instance of map_wall.Then, when you are trying to check if cam_lontana_centro is overlapping map_wall, you are not testing all map_walls, but only that 1 picked instance.

If you modify the code like this it works:

Or you can wrap all checks in functions and use them like this:

And I have to agree with @brunopalermo, the method you are using is not very efficient.

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post

Thank you all!!Bruno Palermo: sei per caso italiano? Io pure!In the past I used the array but I felt that the code was very slow... I will study your example, probably my my past arrays code was really bad !Dop2000: thank you in advance, I will test your information, I hope it work because in this way I can create the map and in the same time the mini-map !