Hello! Thanks for taking the time to enter my topic. I've been trying to fix that for like 10 hours. Tried many different things, all fail.
Overview of what I need and the issue I have with it:
-I have different colors of enemies (color families), and the user can make one color at a time disappear from the screen (they become invisible, solid becomes disabled, and they get pinned to background :: that's what I'll mean in this topic when I say an enemy becomes "inactive"). To make it simple, in my example the user simply presses the arrow keys to decide which one becomes "inactive".
Issue: When an enemy walks in front of an "inactive" enemy, the inactive enemy isn't filtered out correctly and performs an action that should only be performed by an active enemy. In this case, the inactive enemy currently going to the right changes direction ("go_left" boolean variable becomes "true"). I tried to fix that for 10 hours, trying many different ways to filter it out, but everything I try fails. In my last attempt, which is represented below by the sub-events, I tried to use the enemy graphics and then in my last attempt even added a ridiculous opacity check (the inactive enemies now also get their opacity set to 50) so that they would be filtered out for sure, but it still doesn't work. I have no idea why the opacity check doesn't work.
One thing I noticed, it seems that the issue only occurs with the "inactive enemies" with Go_Left set to False. If Go_Left is set to True, the issue doesn't occur and they don't change direction. Which means to reproduce the issue, make an enemy inactive while it is going to the right, wait for the other enemy to walk pass it, then make the inactive enemy active, and you'll see he changed direction.
One way to fix the issue easily would be to code every color family separately, each having their very own "Go_Left" variable. However, that would mean having 4 times more code for everything that has to do with them changing direction (there will be 4 colors in total), and thought it might be the "lazy" way out for me, and that there's probably a better way to fix the issue.
After 10 hours it is getting me insane and thought it would be a good opportunity to ask for help for once. The capx file is attached. Thanks!
Note: I don't know why the pics don't appear here, but if you right click them and copy the url you can check them out!