import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
import java.lang.String.*;
import java.lang.*;
import java.io.*;
public class Block extends JPanel implements
ActionListener,KeyListener//应该是继承JPanel
{
static Button but[] = new Button[6];
static Button noStop = new Button("取 消 暂 停");
static Label scoreLab = new Label("分数:");
static Label infoLab = new Label("提示:");
static Label speedLab = new Label("级数:");
static Label scoreTex = new Label("0");
static Label infoTex = new Label(" ");
static Label speedTex = new Label("1");
static JFrame jf = new JFrame();
static MyTimer timer;
static ImageIcon icon=new ImageIcon("resource/Block.jpg");
static JMenuBar mb = new JMenuBar();
static JMenu menu0 = new JMenu("游戏 ");
static JMenu menu1 = new JMenu("帮助 ");
static JMenuItem mi0 = new JMenuItem("新 游 戏");
static JMenuItem mi1 = new JMenuItem("退出");
static JMenuItem mi1_0 = new JMenuItem("关于");
static JDialog dlg_1;
static JTextArea dlg_1_text = new JTextArea();
static int startSign = 0;//游戏开始标志 0 未开始 1 开始 2 暂停
static String butLab[] = {"开 始 游 戏","重 新 开 始","降 低 级 数","提 高
级 数","游 戏 暂 停","退 出 游 戏"};
static int game_body[][] = new int[19][10];
static int game_sign_x[] = new int[4];//用于记录4个方格的水平位置
static int game_sign_y[] = new int[4];//用于记录4个方格的垂直位置
static boolean downSign = false;//是否落下
static int blockNumber = 1;//砖块的编号
static int gameScore = 0;//游戏分数
static int speedMark = 1;
public static void main(String args[])
{
评论0