1、 int b; int x; int y; int r; int greennum; int greeneat; int orangenum; int orangeeat; boolean GREEN; boolean G; int a1; int b1; int c1; int d1; Font font; String s; String s1; String s2; String s4; String s5; String s6; String s0; String s3; String s7; String ssssssssss; String ssssssss; String sss
2、ssssss; public Lv13() this.state = 1; this.position = new int1313; this.position22 = 1; this.position42 = 1; this.position26 = 1; this.position46 = 1; this.position04 = 1; this.position24 = 1; this.position44 = 1; this.position64 = 1; this.position00 = 2; this.position20 = 2; this.position40 = 2; th
3、is.position60 = 2; this.position02 = 2; this.position62 = 2; this.position08 = 3; this.position28 = 3; this.position48 = 3; this.position68 = 3; this.position06 = 3; this.position66 = 3; this.a = 100; this.c = 100; this.b = 100; this.r = (this.c / 4); this.greennum = 0; this.greeneat = 6; this.orang
4、enum = 0; this.orangeeat = 6; this.GREEN = true; this.font = new Font(华文行楷, 1, 25); this.s = 绿方先走! 请绿方点击自己棋子!; this.s1 = 绿方走动步数: this.s2 = 黄方走动步数: this.s4 = 绿方的棋子数目: this.s5 = 黄方的棋子数目: this.s6 = 温馨提示 :玩家执绿棋! this.s0 = 游戏开始! this.s3 = null; this.s7 = player or computer:from_,_to_,_ this.ssssssssss =
5、以下是一些判断! this.ssssssss = 以下电脑评分走棋 this.sssssssss = 以下电脑按评分走棋 setLayout(null); setTitle(【单机版】六子冲棋1.0版 作者:康子QQ858494658 微信号:hangkanghua 公众号:kzgzsz ); addMouseListener(this); setSize(1000, 700); setLocationRelativeTo(null); setDefaultCloseOperation(3); setResizable(true); setVisible(true); public stati
6、c void main(String args) new Lv13(); public void paint(Graphics g) super.paintComponents(g); Graphics2D g2d = (Graphics2D)g; g2d.setColor(Color.BLACK); drawchessboard(g2d, this.a, this.b, this.c); drawpieces(g2d); g2d.setFont(this.font); g2d.drawString(this.s, 500, 250); g2d.drawString(this.s6, 500,
7、 200); g2d.drawString(this.s7, 500, 320); g2d.drawString(this.s1 + this.greennum, 550, 400); g2d.drawString(this.s2 + this.orangenum, 550, 450); g2d.drawString(this.s4 + this.greeneat, 550, 500); g2d.drawString(this.s5 + this.orangeeat, 550, 550); g2d.drawString(state= + this.state, 500, 150); g2d.d
8、rawString(this.GREEN + + (this.greennum + this.orangenum), 650, 150); g2d.drawString(this.s0, 500, 100); if (this.s3 != null) g2d.drawString(this.s3, 600, 100); public void drawpieces(Graphics2D g2d) for (int i = 0; i 13; i+) for (int j = 0; j j+) int plecesX = this.a + i * this.c / 2; int plecesY =
9、 this.b + j * this.c / 2; if (this.positionij = 2) g2d.setColor(Color.GREEN); g2d.fillOval(plecesX - this.r, plecesY - this.r, 2 * this.r, 2 * this.r); if (this.positionij = 3) g2d.setColor(Color.ORANGE); public void drawchessboard(Graphics2D g2d, int a, int b, int c)= 3;= 4; g2d.drawLine(a + i * c,
10、 b + j * c, a + (3 - i) * c, b + j * c); g2d.drawLine(a + i * c, b + j * c, a + i * c, b + (4 - j) * c); public boolean isnext(int xx, int yy, int x, int y) boolean b = false; if (x = xx) & (y != yy) if (xx = x) & (Math.abs(y - yy) = 2) b = true; else b = false; else if (y = yy) & (x != xx) if (yy =
11、 y) & (Math.abs(x - xx) = 2) else b = false; return b; public void goodwei(int x, int y) if (this.position4y != 1) & (this.position4y = this.position6y) & (this.position0y = 1) & (this.position2y != this.position4y) &= 1) if (this.position2y != this.positionxy) this.position2y = 1; if (!this.GREEN) this.greeneat -= 1; else this.orangeeat -= 1; else if (this.position2y ! (this.position2y = this.position4y) & (this.position0y != this.position2y) & (this.position6y = 1) & if (this.position0y ! this.position0y = 1;
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1