The best advice I can offer is to keep a close eye on your profiler. I almost always run in debugging mode, so that I can individually check variables on instances and so-on. Whenever I find unexpected behaviours, I generally find incorrectly set instance variables, bad calculations, NaNs and floating point errors - which are entirely my fault!
I know it sucks, but the mantra should be to 'fail faster' - then fix the fails.
That's good advice. I don't always run it in debugger, unless this kind of thing happens. I have already done this, though, but I can't for the life of me fix this issue. Here's the issue I'm having right now, and maybe you can give me some more advice. I'm trying to make a shooting enemy that shoots at you every 1.5 seconds, and everything works for the most part, but for some reason when you are on the left side of one, and there are more than one, things go haywire. He shoots in the wrong direction, then he just stops, but all the ones on the left side keep shooting.
I've checked my events, and none of them have anything to do with what side you are on. I thought maybe there was a problem in having them become active at the same time so I set a variable to make them only be active when they get on-screen, but that fixed nothing. I'll supply pictures of my code, but it'll take me a bit to make a capx.
https://www.dropbox.com/s/1lr6ywhhv2dl6 ... 1.png?dl=0
https://www.dropbox.com/s/7ywvbwy3v5w2l ... 2.png?dl=0