I worked on it using your sample but it seems that C2 does not understand this part
As a result, it does not recognize tiles around the cactus.
I downloaded the Capx and it seems like you get confused about the tile coordinates. In the screenshot you are setting a lot of tile positions, which makes little sense. First of all, to do comparisons with a tilemap you don't need/benefit from storing any tile positions. As it contains so many tiles, in theory you don't have to store any tile positions at all, the only reason to do it is because its faster to just store the tile positions than having to convert them all the time. But it makes no different when working with them. When I store tile position for objects, its only for non-tilemap objects, like the bullet sprite and so forth.
Whenever you have to compare something with a tilemap you have to convert the X,Y position that you want to compare or you use the tile position that you generated before hand. Again it makes no difference in how C2 works, its purely for your own sake that you do it!!.
This is the only part that need a conversion, because that is what keep track of the bullet position. And instead of having to keep converting it, whenever i want to compare the bullets position with something on the tilemap. I just do it here and store it in the bullet.
This is where it goes wrong. Because the initial condition and the one we are interested in is the bullet position compared to the tilemap. In the first line i use a "Tilemap.TileAt(Bullet.TileX, Bullet.TileY) = 15" This is the part where i might as well have converted it on the fly, like this:
But as you can see it requires me to write a lot more code, so to save time I just convert it once and use Bullet.TileX and Y instead. But the code does exactly the same.
Moving to 9-11
You are comparing Tilemap.TileX = Bullet.TileX Which is fine.
But you are also comparing Tilemap.TileYmin1 = Bullet.TileY - 1, which doesn't work because that is set in the start of layout, when the bullet position can be anything. So this comparison will never be true, and its the same for all the checks that is done. The reason it write that no tile was found anywhere around the cactus, is because the Else is misplaced, and will always be true because (10) will never be.
The way i would do it, if i understand you correct, is to layout what I want to happen. Meaning write down the flow you need to make it work.
1. Bullet hit cactus
2. Check if there are other cactuses around the bullet.
a. There is another cactus around the bullet -> Do something.
b. There is not another cactus around the bullet -> Go to 3
3. Check if there are any green tiles around the bullet.
a. There is another green tile around the bullet -> Do something.
b. There is no green tile around the bullet[/code:10ged27y]
Then go through each step and add them to the code. Even though you might already know what you want to happen, outlining it can be very helpful I think, especially if you need to keep track of a lot of positions and so on. Because it seems you get confused with what you are trying to do, and what you need to do, to make it work. So you start adding a lot of variables that are not needed.