This is the base for a platformer I was making. Since I'm leaving scratch, I'm giving it to you. For the full spritesheets for all the bad guys, check out www.OpenGameArt.org . Just search for Open Gunner.
Please remix and finish this! The code uses trigonometry courtesy of @The_Mysterious, And also thanks to @The_Mysterious for the x-scrolling.