The effect I’m trying to achieve here is during AI’s turn it will look into the select array to see if the number have been taken by player or not, if not the computer will select the number and disable the position so that player won’t be able to selected. In the same time, the computer will move its character to where the number is located. I do have a long working code but its extremely massy, and its in the attachment. All help are appreciated
aiarray is the order the number that will be selected by AI during its turn
arrayx is the x cordinate for the ai character to move( for example the x cordinate of #7 is 319)
valy is the y cordinate of each number which remain static.
contain is the function that check if the number exist in the select array or not.
select are all the number that have not been selected
cho are the location that ai char will move
public var aiarray:Array=new Array(null,7,6,8,5,9,4,10,3,11,2,12,1,13,14)
public var arrayx:Array=new Array(null,319,265,375,210,428,157,486,97,545,51,600,10,656,717)
public var valy:int=492
for(i=1;i<14;i++){
if(contain(aiarray*,select)==1){
compsele.push(aiarray*)
("cho"+i).mouseEnabled=false
("computerchar"+turn).x=arrayx*
("computerchar"+turn).y=valy
turn--
trace("hello")
}
break;
}