語言程序設計資料:俄羅斯方塊-java語言.doc
《語言程序設計資料:俄羅斯方塊-java語言.doc》由會員分享,可在線閱讀,更多相關《語言程序設計資料:俄羅斯方塊-java語言.doc(25頁珍藏版)》請在匯文網上搜索。
1、import java.awt.*;import java.applet.Applet;public class Blocks extends Applet implements RunnableDimension d;Font largefont= new Font(Helvetica, Font.BOLD, 28);Font smallfont= new Font(Helvetica, Font.BOLD, 10);Color textcolor1=new Color(96,128,255);Color textcolor2=new Color(255,160,64);FontMetric
2、s fmsmall, fmlarge;Graphics goff;Image ii;Threadthethread;boolean ingame=false;final short xblocks=10;final short yblocks=20;final int blocksize=16;final int width=xblocks*blocksize;final int height=yblocks*blocksize;short screendata;final short maxcolors=6;Color blocks;final int barwidth=8;final Co
3、lor barcolor=new Color(128,255,64);final Color background=new Color(0,0,0);int score;short emptyline;int objectx, objecty;int objectx;short objecttype;short objectcolor;int objectrotation;int objectrotationd=0;short objectptr;short checkptr;final short itemcount=7;final short itemrotlen=8;final shor
4、t itemlen=itemrotlen*4;short count;final short maxcount=5;short curcount;boolean fast=false;final short screendelay=40;short screencount=40;boolean showtitle=true;int items=0,0, -1,0, 0,-1, -1,-1, /四方形,正常狀態(tài)0,0, -1,0, 0,1, -1,1, /被旋轉90度0,0, 1,0, 0,1, 1,1,0,0, 1,0, 0,-1, 1,-1,0,0, 0,-1, 0,-2, 0,-3,0,0
5、, -1,0, -2,0, -3,0,0,0, 0,1, 0,2, 0,3,0,0, 1,0, 2,0, 3,0,0,0, 1,0, 0,-1, -1,-1,0,0, 0,-1, -1,0, -1,1,0,0, -1,0, 0,1, 1,1,0,0, 0,1, 1,0, 1,-1,0,0, -1,0, 0,-1, 1,-1,0,0, 0,1, -1,0, -1,-1,0,0, 1,0, 0,1, -1,1,0,0, 0,-1, 1,0, 1,1,0,0, 1,0, -1,0, 0,-1,0,0, 0,1, 0,-1, -1,0,0,0, 0,1, -1,0, 1,0,0,0, 1,0, 0,-
6、1, 0,1,0,0, 0,-1, 1,-1, 0,1,0,0, -1,0, -1,-1, 1,0,0,0, -1,1, 0,1, 0,-1,0,0, -1,0, 1,0, 1,1,0,0, 0,1, 0,-1, -1,-1,0,0, 1,0, -1,0, -1,1,0,0, 0,-1, 0,1, 1,1,0,0, -1,0, 1,0, 1,-1,;int checks=-1,1, 0,1, -1,1, 0,1,-1,2, 0,2, -1,2, 0,2,0,2, 1,2, 0,2, 1,2,0,1, 1,1, 0,1, 1,1,0,1, 0,1, 0,1, 0,1,0,1, -1,1, -2,
- 配套講稿:
如PPT文件的首頁顯示word圖標,表示該PPT已包含配套word講稿。雙擊word圖標可打開word文檔。
- 特殊限制:
部分文檔作品中含有的國旗、國徽等圖片,僅作為作品整體效果示例展示,禁止商用。設計者僅對作品中獨創(chuàng)性部分享有著作權。
- 關 鍵 詞:
- 語言程序設計 資料 俄羅斯方塊 java 語言