iOS & iPadOS Gaming

I just got the Nebula game. I studied the tutorial, but I must have not understood something, because I get killed pretty quick. When an enemy shows up, I try to get near him and shoot while he's not shooting, then go away again. This clearly is wrong. Can anyone give me a hint about what to do?