enemywalkright = {image.load("img/enemyright/spyker1.png"),
image.load("img/enemyright/spyker2.png")}

enemywalkleft = {image.load("img/enemyleft/spyker1.png"),
image.load("img/enemyleft/spyker2.png")}

enemydieright = {image.load("img/enemyright/spkill.png"),
image.load("img/enemyright/spkill2.png"), 
image.load("img/enemyright/spkill3.png"),
image.load("img/enemyright/spkill4.png")}

enemydieleft = {image.load("img/enemyleft/spkill.png"),
image.load("img/enemyleft/spkill2.png"), 
image.load("img/enemyleft/spkill3.png"),
image.load("img/enemyleft/spkill4.png")}

oldEnemy={}
Enemy={}
Mapwidth  = #world[1]

function generateenemies()  -- a function to generate enemies  
for i = 1 , 5  do 
		Enemy[i]  =  { } 
                Enemy[i].timer = 0
                Enemy[i].show = "true"
		Enemy[i].img = enemywalkright[1]
		Enemy[i].width =  Enemy[i].img:width()
		Enemy[i].height =  Enemy[i].img:height()
		Enemy[i].x = math.random ( 280, (Mapwidth*tilesizeX) - Enemy[i].width)
		Enemy[i].y =  200
		Enemy[i].speedY = 0
		Enemy[i].speedX = 1
		Enemy[i].jumping = "false"
		Enemy[i].direction="left"
		Enemy[i].alive = "true"
		Enemy[i].xmove = -1
                Enemy[i].play = "false"
		end
end