2d Sidescroller Enemy Help

Hey there guys. I’m in the process of creating a 2d sidescrolling game. I’ve got most of my basic movement/camera scripts down and the start of a decent level, but I’m having trouble with my enemy script. Does anyone out there have any knowledge of how I could create an enemy script that would attack/rotate accordingly in relation to my character?

Thanks!

Bump. Forgot to mention I’m using java code