--Others personnage
PlayerIA={n=0}

function PlayerIA.new(fichier,x,y)
     PlayerIA.n=PlayerIA.n+1
     PlayerIA[PlayerIA.n]=Monster.new(fichier,1,2,x,y)
end


function PlayerIA.get(x,y)
     if PlayerIA.n>0 then
         for i=1,PlayerIA.n do
             if (PlayerIA[i].x==x and PlayerIA[i].y==y) then
				 return true
			 end
			 if (PlayerIA[i].x==x and PlayerIA[i].y==y+1) then
				 return true
			 end
         end
	 end
	 return false
end

function PlayerIA.destroy(x,y)
     if PlayerIA.n>0 then
         for i=1,PlayerIA.n do
		     --screen:print(10,10,"x : "..x.."y : "..y.." X : "..PlayerIA[i].x.." /Y : "..PlayerIA[i].y)
             if (PlayerIA[i].x==x and PlayerIA[i].y==y) then
			     PlayerIA[i]:kill()
				 return true
			 end
			 if (PlayerIA[i].x==x and PlayerIA[i].y==y+1) then
			     PlayerIA[i]:kill()
				 return true
			 end
         end
	 end
	 return false
end

function PlayerIA.play()
     if PlayerIA.n>0 then
         for i=1,PlayerIA.n do
             PlayerIA[i]:playIa()
         end
	 end
end
