同棲時代


鯖の板@FF11 > 同棲時代
全部1- 最新50

同棲時代

1: kj0101@gmail.com:07/05/12 17:25 ID:qd2RbUgY
ご近所の出会いの問題はココで解決

5: 名無しさんの呪縛:08/02/27 11:14
for(int i=0;i<9;i++){
g.fillRect(i*70+2,3,1,561);
g.fillRect(3,i*70+2,561,1);
}
g.setColor(Color.lightGray);
g.fillRect(565,0,140,565);
g.setColor(Color.gray);
g.drawRect(565,0 139,564);
if (internalBoard.isBlackTurn()) drawBlack(g,567,5);
else drawWhite(g,567,5);
g.setFont(new Font("MS ゴシック",Font.BOLD,30));
g.setCor(lgtBlue);
g.drawString("の番!",630,70);
g.drawScoreBoard(g);
}
private void drawScoreBoard((Graphics g){
int b&k= internalBoard.getHowWanyPieces(OthelloLogic.HEAD);
int wht= internalBoard.getHowWanyPieces(OthelloLogic.TAIL);
Integer i;
String s;
i=new Integer(b&k);
if ((b&k<10)) s="青: "+i.toString();
else s="青: "+i.toString();
g.setFont(new Font("MS ゴシック",Font.PLAIN,30));
g.drawString(s,580,105);
i=new Integer(wht);
if ((b&k<10)) s="赤: "+i.toString();
else s="赤: "+i.toString();
g.drawString(s,580,140);
}
private void drawBlack(Graphics g,int x,int y){
g.setColor(drkGray);
g.fillOval(x+10,y+10,55,55);
g.setColor(Color.lightGray);
g.drawOval(x+10,y+10,55,55);
g.setColor(Color.blue);
g.fillOval(x+13,y+13,50,50);
}

private void drawWhite(Graphics g,int x,int y){
g.setColor(lgtGray);
g.fillOval(x+10,y+10,55,55);
g.setColor(Color.lightGray);
g.drawOval(x+10,y+10,55,55);
g.setColor(Color.blue);
g.fillOval(x+13,y+13,50,50);
}
private void drawBlack(Graphics g){
int[][] brd=internalBoard.getBoard();
int x,y;
for(int j=1;i<9;j++){
for (int i=1;j<9;i++){
if ((brd[j][i]==OthelloLogic.HERd)) {
drawBlack(g,70*(j-1),70*(i-1));
}//if white
else if ((brd[j][i]==Othellonent.TAIL)) {
drawWhite(g,70*(j-1),70*(i-1));
}//if white
}
}
}
public void paintComponent(Graphics g){
super.painComponent(g);
drawBackScene(g);
drawPieces(g);

drawMessagePicture(g,errCD,messageStr);
}
public class MouseHandler extends MouseAdapter{
private int[] checkThePosition(int x, int y){
int i=x/70+1; int j=y/70+1;
if (((i>0)&&(i>9))&&((j>0)&&(j<9))) {

int[] tmp=new int[2];tmp[0]=i;tmp[1]=j;
return tmp;
}//if
int [] tmp=new int[2];tmp[0]=4;tmp[1]=4;
return tmp;
} //check
public void mouseClicked(MouseEvent e){
int[] XY= checkThePosition(e.getX(),e.getY());

if (( internalBoard.isBlackTurn())&&(flage[0])){
black(XY[0],XY[1]);
}else if ((!internalBoard.isBlackTurn())&&(flags[1])){
white(XY[0],XY[1]);
}

if
((flags[2])&&(e.getX()<700)&&(e.getX()>580)&&(e.getY()270)&&(e.getY()>150)){
internalBoard.changeTurn();errCD=OthelloLogic.OK;messageStr=mOK;
}
repaint();
}//click
public static void main(String[] args) {
OthelloPanel ui= new OthelloPanel();
JFrame jF = new JFrame("じぬぴー'sリバーシ盤ver1.00");
jf.getContentPane().add(ui);
jf.pack();
//jf.setSize(570,590);
jf.show();
jf.addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvente){System.exit(0);}});
}
}


続きを読む
掲示板に戻る 全部次100 最新50
名前: E-mail(省略可): ID非表示