2D game ai help

hi ,
i am working on a 2d game , in which player moves upward continuously, and there are some enemies on screen .
user can move player left or right to avoiding hiting enemy,
for detail see the picture.1590531--95436--$demo.png

the problem is how make an ai generate enemies at runtime
there are four types of enemies with different difficulty level
i want generate easy enemy at start and the time i want to make the difficulty level high by creating difficult enemies.

i will be very thankful if someone can help me or refer some ai algorithm
thanks in advance , and sorry for my bad english.

ALL PSEUDOCODE…

Create an enum of difficulties….enum Difficulty.easy, Difficulty.hard …etc

when you instantiate the enemy, have it choose a random difficulty and assign it…

so in the enemy Class have a variable that you set in the Start()

public class enemy…

enum difficulty…

private difficulty _d;

void start(){
r=random.range(0,2)

switch r
if r=0 then _d=difficulty.easy

…etc

}