Enemy's in 2D Space Shooter?

Hi!
I’ve made a short 2D Space Shooter like Gradius for my friend.
I have almost everything except the enemys.

What is the best way to include it?
How could I do it that the enemy have a certain movement pattern and that they shoot
on the player?

Is there some free source code from other games to look how they done it?

What you are talking about is AI (Artificial Intelligence).
Basically you need to decide what paths you want the enemies to move: do you want them to follow your player or move randomly? Then implement based on your ideas.

It is best to read up about it on Google.

EDIT: Coincidentally, someone else on this forum asked the exact same question and here is a good reply.