Hi,
I’m trying to create a variation on the slidepuzzle. When certain areas are uncovered (when set coordinations are not used) you win.
here’s what i got so far:
var otherBlocks:Array = [1,2,3,4,5,6,7,8,9];
mcsubmit.addEventListener(MouseEvent.CLICK, checkWin);
function checkWin(event:MouseEvent){
//if x = 150, y = 150 not used you win)
if (x = 150, y = 150 && x = 250, y =250)
{
trace ("you win");
//gotoAndPlay(3);
}
else
{
trace ("wrong");
//gotoAndPlay(2);
}
}
function movement(event:MouseEvent){
//remove currentblock from array.
if (event.currentTarget.x += 100 || event.currentTarget.x -=100 || event.currentTarget.y += 100 || event.currentTarget.y -= 100 == y.[otherBlocks]
&&|| x.[otherBlocks]){
}
else(){event.currentTarget.y += 100 || event.currentTarget.y -= 100 || event.currentTarget.x +=100 || event.currentTarget.x -=100 }
//depending which position is available you slide there.
//return new coordinates and start loop again with new coordinates.
}
mcBlock1.Array[1].addEventListener(MouseEvent.CLICK, movement);
mcBlock2.Array[2].addEventListener(MouseEvent.CLICK, movement);
mcBlock3.Array[3].addEventListener(MouseEvent.CLICK, movement);
//etc
I’ll appreciate any help or tips on this.