贪吃蛇Java源码分析
关键字:贪吃蛇 Java 源码import java .awt.*; importjava.awt.event.*; importjavax.swing.*; importjava.util.*; //============================================= //MainClass //============
关键字:贪吃蛇
Java源码import
java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
//=============================================
//Main Class
//=============================================
public class GreedSnake implements KeyListener
{
JFrame mainFrame;
Canvas paintCanvas;
JLabel labelScore;//计分牌
SnakeModel snakeModel=null;// 蛇
public static final int canvasWidth=200;
public static final int canvasHeight=300;
public static final int nodeWidth=10;
public static final int nodeHeight=10;
//----------------------------------------------------------------------
//GreedSnake():初始化
游戏界面
//----------------------------------------------------------------------
public GreedSnake()
{
原文转自:http://www.ltesting.net