import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
TRTRIS GAME
WRITE BY DELFAN
EMAIL : webmaster@delfan.com
URL : http://www.delfan.com
¾µä"¶íÂÞ˹·½¿é"ÓÎÏ·
×÷Õß : DELFAN
EMail : webmaster@delfan.com
Ö÷Ò³ : http://www.delfan.com
°æ±¾ÐÅÏ¢:
2002.01.13 »ù±¾Íê³É
ÇëÈκÎʱºò¶¼±£ÁôÒÔÉÏÐÅÏ¢.лл!
*/
public class tetris extends Applet implements Runnable
{
Thread thread;
private Image offImg; // »º³åͼÏó
private Graphics offG; // »º³å
final int BaseX = 20;
final int BaseY = 20;
final int BlockSize = 20; // ÿ¸ö¿éµÄ´óС
//
// ¶¨ÒåÓÎÏ·ÖгöÏÖµÄÐÅÏ¢
//
final String INFO_READY = "S¼ü ¿ªÊ¼ÓÎÏ·";
final String INFO_PAUSE = "P¼ü ¼ÌÐøÓÎÏ·";
final String INFO_GAMEOVER = "ÓÎÏ·½áÊø ÈÎÒâ¼ü¼ÌÐø";
byte SHAPE[][][][] = // [ÔìÐÍË÷Òý][ÐýתË÷Òý][4][×ø±ê]
{
{ // ÔìÐÍÒ»
{{ 0, 0},{ 1, 0},{ 0, 1},{ 1, 1}}, // Ðýתһ [][]....
{{ 0, 0},{ 1, 0},{ 0, 1},{ 1, 1}}, // Ðýת¶þ [][]....
{{ 0, 0},{ 1, 0},{ 0, 1},{ 1, 1}}, // ÐýתÈý .........
{{ 0, 0},{ 1, 0},{ 0, 1},{ 1, 1}} // ÐýתËÄ .........
},
{ // ÔìÐͶþ
{{-1, 0},{ 0, 0},{ 0, 1},{ 1, 1}}, // Ðýתһ []
{{ 0,-1},{ 0, 0},{-1, 0},{-1, 1}}, // Ðýת¶þ []() []()
{{-1, 0},{ 0, 0},{ 0, 1},{ 1, 1}}, // ÐýתÈý [][] []
{{ 0,-1},{ 0, 0},{-1, 0},{-1, 1}} // ÐýתËÄ
},
{ // ÔìÐÍÈý
{{ 1, 0},{ 0, 0},{ 0, 1},{-1, 1}}, // Ðýתһ []
{{ 0,-1},{ 0, 0},{ 1, 0},{ 1, 1}}, // Ðýת¶þ ()[] ()[]
{{ 1, 0},{ 0, 0},{ 0, 1},{-1, 1}}, // ÐýתÈý [][] []
{{ 0,-1},{ 0, 0},{ 1, 0},{ 1, 1}} // ÐýתËÄ
},
{ // ÔìÐÍËÄ
{{ 0, 0},{ 1, 0},{ 2, 0},{ 0, 1}}, // Ðýתһ [] []
{{ 0,-2},{ 0,-1},{ 0, 0},{ 1, 0}}, // Ðýת¶þ ()[][] []() [][]() []
{{-2, 0},{-1, 0},{ 0, 0},{ 0,-1}}, // ÐýתÈý [] [] ()[]
{{-1, 0},{ 0, 0},{ 0, 1},{ 0, 2}} // ÐýתËÄ []
},
{ // ÔìÐÍÎå
{{-2, 0},{-1, 0},{ 0, 0},{ 0, 1}}, // Ðýתһ []
{{ 0, 0},{ 1, 0},{ 0, 1},{ 0, 2}}, // Ðýת¶þ [][]() [] [] ()[]
{{ 0,-1},{ 0, 0},{ 1, 0},{ 2, 0}}, // ÐýתÈý [] []() ()[][] []
{{ 0,-2},{ 0,-1},{ 0, 0},{-1, 0}} // ÐýתËÄ []
},
{ // ÔìÐ
×î½üÒ»Ö±ÔÚдC#µÄUDPͨѶ·½ÃæµÄ³ÌÐò£¬³é¿Õ°ÑÒÔǰдµÄJavaµÄUDPͨѶ³ÌÐòÄóöÀ´×öÁËһЩÉý¼¶µÄÐ޸ģ¬°ÑÒÔǰһЩ²»×ãµÄµØ·½×öÁ˸Ķ¯£¬Í¬Ê±Ê¹ÓÃexe4jÈí¼þ±àÒë³ÉexeÎļþ£¬Èí¼þЧ¹ûÈçÏÂËùʾ£º
ͬʱ°Ñ´úÂëÌù³öÀ´£¬ÒÔ¹©´ó¼ÒÖ¸µãÒ»¶þ¡£
Main.java(Ö÷º¯Êý)
/*
* To change this template, choose Tools | Templates
......