|
java网络五子棋的源代码(26) g.fillOval(337,97,6,6); g.fillOval(97,337,6,6); g.fillOval(337,337,6,6); g.fillOval(217,217,6,6); } public void chessPaint(int chessPoint_a,int chessPoint_b,int color) { chessPoint_black chesspoint_black=new chessPoint_black(this); chessPoint_white chesspoint_white=new chessPoint_white(this);
if(color==1 && isMouseEnabled) { getLocation(chessPoint_a,chessPoint_b,color); isWin=checkWin(chessPoint_a,chessPoint_b,color); if(isWin==false) { chessthread.sendMessage("/"+chessPeerName+" /chess "+chessPoint_a+" "+chessPoint_b+" "+color); this.add(chesspoint_black); chesspoint_black.setBounds(chessPoint_a*20-7,chessPoint_b*20-7,16,16); statusText.setText("黑(第"+chessBlackCount+"步)"+chessPoint_a+" "+chessPoint_b+",请白棋下子"); isMouseEnabled=false; } else { chessthread.sendMessage("/"+chessPeerName+" /chess "+chessPoint_a+" "+chessPoint_b+" "+color); this.add(chesspoint_black); chesspoint_black.setBounds(chessPoint_a*20-7,chessPoint_b*20-7,16,16); chessVictory(1); isMouseEnabled=false; } } else if(color==-1 && isMouseEnabled)
|