All pastes #839471 Raw Edit

Something

public text v1 · immutable
#839471 ·published 2007-12-31 01:10 UTC
rendered paste body
on(release){
    if(_root.activePiece!=0)
    {
    _root.click[0]=((_root.mouse._x/100)%7)-1 //_root.click[0] is the x coord, click[1] is the y
    _root.click[1]=((_root.mouse._y/100)%7)-1
    if((-1<=_root.click[0]-_root.activePiece[0]<=1)&&(-1<=_root.click[1]-_root.activePiece[1]<=1)&&(_root.click[0]==_root.activePiece[0]&&_root.click[1]==_root.activePiece[1])){
        //dupe piece
        _root.board[_root.click[0]][_root.click[1]]=_root.currentPlayerNum;
        _root.checkSurrounding();
    }
    else if((-2<=_root.click[0]-_root.activePiece[0]<=2)&&(-2<=_root.click[1]-_root.activePiece[1]<=2)&&(_root.click[0]==_root.activePiece[0]&&_root.click[1]==_root.activePiece[1])){
        //move piece
        _root.board[_root.activePiece[0]][_root.activePiece[1]]=0;
        _root.board[_root.click[0]][_root.click[1]]=_root.currentPlayerNum;
        _root.checkSurrounding(_root.click[0],_root.click[1]);
    }

}


checkSurrounding(){
//change all the pieces surrounding _root.ActivePiece
}