This code can be copied! You decide whether you want to give this credit in your project or if it helped you enough. This shows how to automatically shoot bullets at a main character (the Scratch cat in this case)
I have used a similar mechanic in my project "Driving shooters" (see my profile if you want to check it out)