急需基于eclipse的JAVA小游戏源代码!!! 10

!最好是整个工程,包括图片啊什么素材,导入就可运行的,或者每个.class文件都分开,我粘贴在elipse里就能运行的~~~~~~谢谢万分感谢~~~~~要交的作业啊,好心的高手来帮帮忙吧!(只有10 分了 抱歉
我的邮箱 malan_gjx@sohu.com
我有更好的答案
推荐于2017-11-23 13:57:57 最佳答案
WHITE);
g.drawLine(i;30-1] = 2单人版五子棋;j++)
{
if(chess[i][j] == 1)
{
black_count++;
if(black_count == 5)
{
JOptionPane.showMessageDialog(this, "黑棋胜利");
Clear_Chess();
return;
}
}
else
{
black_count = 0;
}
if(chess[i][j] == 2)
{
white_count++;
if(white_count == 5)
{
JOptionPane.showMessageDialog(this, "白棋胜利");
Clear_Chess();
return;
}
}
else
{
white_count = 0;
}
}
}

for(i = 0;i < 11;i++)//竖向判断
{
for(int j = 0;j < 11;j++)
{
if(chess[j][i] == 1)
{
black_count++;
if(black_count == 5)
{
JOptionPane.showMessageDialog(this, "黑棋胜利");
Clear_Chess();
return;
}
}
else
{
black_count = 0;
}
if(chess[j][i] == 2)
{
white_count++;
if(white_count == 5)
{
JOptionPane.showMessageDialog(this, "白棋胜利");
Clear_Chess();
return;
}
}
else
{
white_count = 0;
}
}
}

for(i = 0;i < 7;i++)//左向右斜判断
{
for(int j = 0;j < 7;j++)
{
for(int k = 0;k < 5;k++)
{
if(chess[i + k][j + k] == 1)
{
black_count++;
if(black_count == 5)
{
JOptionPane.showMessageDialog(this, "黑棋胜利");
Clear_Chess();
return;
}
}
else
{
black_count = 0;
}
if(chess[i + k][j + k] == 2)
{
white_count++;
if(white_count == 5)
{
JOptionPane.showMessageDialog(this, "白棋胜利");
Clear_Chess();
return;
}
}
else
{
white_count = 0;
}
}
}
}

for(i = 4;i < 11;i++)//右向左斜判断
{
for(int j = 6;j >= 0;j--)
{
for(int k = 0;k < 5;k++)
{
if(chess[i - k][j + k] == 1)
{
black_count++;
if(black_count == 5)
{
JOptionPane.showMessageDialog(this, "黑棋胜利");
Clear_Chess();
return;
}
}
else
{
black_count = 0;
}
if(chess[i - k][j + k] == 2)
{
white_count++;
if(white_count == 5)
{
JOptionPane.showMessageDialog(this, "白棋胜利");
Clear_Chess();
return;
}
}
else
{
white_count = 0;
}
}
}
}

}
void Clear_Chess()
{
for(int i=0;i<11;i++)
{
for(int j=0;j<11;j++)
{
chess[i][j]=0;
}
}
repaint();
}
public void paint(Graphics g)
{
Drawline(g);
Drawchess(g);
}
public void mouseExited(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseReleased(MouseEvent e){}
public void mouseClicked(MouseEvent e){}

}

class myframe extends Frame implements WindowListener
{
mypanel panel;
myframe()
{
setLayout(null);
panel = new mypanel();
add(panel);
panel.setBounds(0,23, 360, 360);
setTitle("单人版五子棋");
setBounds(200, 200, 360, 383);
setVisible(true);
addWindowListener(this);

}
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowDeactivated(WindowEvent e){}
public void windowActivated(WindowEvent e){}
public void windowOpened(WindowEvent e){}
public void windowClosed(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
}
public class mywindow
{
public static void main(String argc [])
{
myframe f = new myframe();
}
};
}
if(chess[i][j] == 2)
{
g; 11; 25 || y > 330+25)
{
return;
}
if(chess[x/i <, 16);
}
}
}
}
void Justisewiner()
{
int black_count = 0;30-1][y/i <30-1] != 0)
{
return;
}
if(Is_Black_True == true)
{
chess[x/,直接用dos就可以了。;
int white_count = 0;
int i = 0;

for(i = 0;
return;
}
}
void Drawline(Graphics g)
{
for(int i = 30;i <= 330;i += 30)
{
for(int j = 30;30-1] = 1, 330);j <
repaint(), 16, (j + 1) * 30 - 8.*;
for(int i = 0, 330, j);
}

}
void Drawchess(Graphics g)
{
for(int i = 0;i < 11;i++)
{
for(int j = 0;j < 11;j++)
{
if(chess[i][j] == 1)
{
g.setColor(Color;
}
}
addMouseListener(this);
setBackground(Color.BLUE);
setBounds(0, 0.fillOval((i + 1) * 30 - 8;
Is_Black_True = false;
g.setColor(Color.WHITE); 11.WHITE);
g.drawLine(30, j;
}
public void mousePressed(MouseEvent e)
{
int x = e;= 330; j+= 30)
{
g.setColor(Color;
}
}

for(int j = 30;j <= 330;j += 30)
{
g.setColor(Color, j, i.swing;
Is_Black_True = true;
repaint();
Justisewiner(); 11; 330 + 25 ||y <30-1][y/
}
if(Is_Black_True == false)
{
chess[x/j <30-1][y/, 360, 360);
setVisible(true).getY();

if(x < 25 || x >.getX();
int y = e;横向判断
{
for(int j = 0;

class mypanel extends Panel implements MouseListener
{
int chess[][] = new int[11][11];
boolean Is_Black_True;
mypanel()
{
Is_Black_True = true。
---------------------
import java.awt.*;
import java.awt.event.*;
import javax,不用导入,直接新建一个mywindow类就行,然后把一下代码粘贴就Ok了。或者;i++)
{
for(int j = 0;j < 11;j++)
{
chess[i][j] = 0;
Justisewiner();
return;i++)//.BLACK);
g.fillOval((i + 1) * 30 - 8, (j + 1) * 30 - 8, 16, 16)

bill76554792

采纳率:31% 擅长: JAVA相关

其他回答

现在在实验室.COM

楼主 我有的 你给我发个邮件 主题说明下 我会给你发的。我最近也在用eclipse跑j2me的小游戏

晚上我才回寝室,在寝室的电脑上maxueruby001@163
maxueruby | 发布于2010-07-08
评论
我有写过一些小游戏,如果坦克,贪吃蛇,不知道你能不能用,
576648859@qq.com
慕树浮云 | 发布于2010-07-08
评论

为您推荐:

×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消