亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? russioncube.txt

?? 這是一個小的用java語言編寫的俄羅斯方塊源程序
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
/* RussionCube.java 1.0.0 
* Copyright (C) 1998 Ryan O'Connell 
* flyfan add the keydown listen , it can handle it easier more than before. 
* flyfan add the paramter control the level then you can control the game speed. 
* 
* This program is free software; you can redistribute it and/or modify 
* it under the terms of the GNU General Public License as published by 
* the Free Software Foundation; either version 2 of the License, or 
* (at your option) any later version. 
* 
* This program is distributed in the hope that it will be useful, 
* but WITHOUT ANY WARRANTY; without even the implied warranty of 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
* GNU General Public License for more details. 
* 
* You should have received a copy of the GNU General Public License 
* along with this program; if not, write to the Free Software 
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
* 
* Notes: 
* 1) I use bit windows to code in. It'll look odd in 80 columns. 
* 2) In Netscape, (Not in appletviewer) getGraphics is only useful for retrieving 
* graphics information such as string metrics, not for actual real-time drawing 
* work. To get a valid Grapics handle, you need to call repaint(). 
* Hence kludgeflag... 
* 
* To Do: 
* 1) Need 7 gif files named: left.gif, right.gif, down.gif, JTeris.gif 
  buttons.gif, clockwise.gif, anticlockwise.gif, 
* 2)Stop the game from running before graphics have been loaded in. 
* 3) Fix game-paused redraw bug 
* 4) To run in browser, add this to webpage: 
     <APPLET CODE="RussionCube.class" WIDTH="400" HEIGHT="400"> 

* Bug: 
  1)probable you must recompile the java source  code if you copy the all class . 
  2)it will spend some memory if you open it more than once time. 

*/ 

import java.awt.*; 
import java.awt.Image; 
import java.awt.image.*; 
import java.net.*; 

public class RussionCube extends java.applet.Applet 
{ // Creates the Board and buttons then just sits there responding to events... 
   Thread DropperThread = null; 
   Board board; 
   TextField score; 
   DisplayPiece piece; 
    
   public void init() 
   { // Creates pretty buttons. 
      Icon icon; 
      Picture picture; 
      Button button1, button2; 
      Image image; 
      ImageFilter imagefilter; 



      setLayout(null); 
      this.setBackground(new Color(0, 0, 0)); 

      image = getImage(getCodeBase(), "left.gif"); 
      add(icon = new Icon(image, 1)); 
      icon.reshape(172, 170, 36, 36); 

      image = getImage(getCodeBase(), "anticlockwise.gif"); 
      add(icon = new Icon(image, 2)); 
      icon.reshape(216, 170, 36, 36); 

      image = getImage(getCodeBase(), "down.gif"); 
      add(icon = new Icon(image, 3)); 
      icon.reshape(260, 170, 36, 36); 

      image = getImage(getCodeBase(), "clockwise.gif"); 
      add(icon = new Icon(image, 4)); 
      icon.reshape(304, 170, 36, 36); 

      image = getImage(getCodeBase(), "right.gif"); 
      add(icon = new Icon(image, 5)); 
      icon.reshape(348, 170, 36, 36); 

      image = getImage(getCodeBase(), "RussionCube.gif"); 
      add(picture = new Picture(image)); 
      picture.reshape(192, 210, 180, 139); 

      add(button1 = new Button("New Game")); 
      button1.setBackground(new Color(128, 128, 128)); 
      button1.move(180, 8); 
      button1.setSize(new Dimension(96, 32)); 

      add(button2 = new Button("Pause")); 
      button2.setBackground(new Color(128, 128, 128)); 
      button2.move(284, 8); 
      button2.setSize(new Dimension(96, 32)); 

      add(score = new TextField("Score: 0")); 
      score.setBackground(new Color(128, 128, 128)); 
      score.setEditable(false); 
      score.move(232, 48); 
      score.resize(new Dimension(96, 32)); 

      add(board = new Board()); 
      board.reshape(24, 8, 120, 324); 
      board.start(); 

      add(piece = new DisplayPiece(board)); 
      piece.reshape(246, 88, 68, 68); 
   } 

   public void paint(Graphics g) 
   { // Redraw border. 
      int x, y; 

      g.setColor(new Color(0, 128, 255)); 

      for (y = 8; 
      y <= 332; 
      y += 12) 
      g.fill3DRect(12, y, 12, 12, true); 

      for (y = 8; 
      y <= 332; 
      y += 12) 
      g.fill3DRect(144, y, 12, 12, true); 

      for (x = 24; 
      x <= 132; 
      x += 12) 
      g.fill3DRect(x, 332, 12, 12, true); 
   } 

   // 處理鍵盤事件  flyfan modify 2003/3/6 
  public boolean keyDown(Event e,int key) 
  { 
    switch(key) 
    { 
      case Event.UP: 
      board.rotateClockwise(); 
        break; 
      case Event.LEFT: 
        board.moveLeft(); 
        break; 
      case Event.RIGHT: 
        board.moveRight(); 

        break; 
      case Event.DOWN: 
        board.drop(); 
        break; 
      case 32: 
        board.drop(); 
        break; 
      default: 
        break; 
    } 
    return true; 
  } 

// **********************************監聽各圖端是否有鼠標事件**** 

   public boolean action(Event event, Object object) 
   { // Responds to Button/Icon clicks 
      Icon icon; 

      if (event.target instanceof Icon) 
      { 
         // Has an icon has finished loading? 
         icon = (Icon) event.target; 

         if (icon.getNumber() == 1) 
         board.moveLeft(); 
         if (icon.getNumber() == 2) 
         board.rotateAntiClockwise(); 
         if (icon.getNumber() == 3) 
         board.drop(); 
         if (icon.getNumber() == 4) 
         board.rotateClockwise(); 
         if (icon.getNumber() == 5) 
         board.moveRight(); 
         return true; 
      } 
      if (event.target instanceof Button) 
      { 
      if (((String)object).equals("New Game")) 
         board.newGame(); 
      if (((String)object).equals("Pause")) 
         board.pause(); 
      return true; 
      } 
      if (event.target instanceof Board) 
      { 
      if (event.id == -1) 
         { 
            piece.repaint(); 
            return true; 
         } 
         score.setText("Score: " + event.id); 
         return true; 
      } 
      return false; 
   } 
} 

class Board extends Panel implements Runnable 
{ // All the real work is done in here. 
   int BoardArray[][]; 
   Color Colours[]; 
   boolean boardinitialized = false, StillRunning = false; 
   boolean Paused = false, kludgeflag = false, forceredraw = false, GameOver = false; 
   int CurrentBlockX = 0, CurrentBlockY = 0, CurrentBlockColour = 0; 
   int CurrentBlockShape, CurrentBlockAngle; 
   int NextBlockX = 0, NextBlockY = 0; 
   int NextBlockColour = 0, NextBlockShape, NextBlockAngle; 
   int LastX, LastY, LastAngle, score = 0, delay = 500; 

   // { X, Y } information relative to CurrentBlock[XY]. 
   // BlockInfo[Shape][Angle, +ve clockwise][BlockNumber][X/Y]; 
   int BlockInfo[][][][] = { { { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } }, // Square 
   { { 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 }, { 1, 0 }, { 0,-1 } }, // T 
   { { 0, 0 }, { 0, 1 }, { 1, 0 }, { 0,-1 } }, 
   { { 0, 0 }, { 0, 1 }, { 1, 0 }, {-1, 0 } }, 
   { { 0, 0 }, { 0, 1 }, { 0,-1 }, {-1, 0 } } }, 
   { { { 0, 0 }, {-1, 0 }, { 1, 0 }, { 2, 0 } }, // 
   { { 0, 0 }, { 0,-1 }, { 0, 1 }, { 0, 2 } }, 
   { { 0, 0 }, {-1, 0 }, { 1, 0 }, { 2, 0 } }, 
   { { 0, 0 }, { 0,-1 }, { 0, 1 }, { 0, 2 } } }, 
   { { { 0, 0 }, { 0,-1 }, { 0, 1 }, { 1, 1 } }, // L 
   { { 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 } }, // Inverted L 
   { { 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 }, {-1, 0 }, { 0,-1 }, { 1,-1 } }, // S 
   { { 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 } }, // Z 
   { { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1,-1 } }, 
   { { 0, 0 }, { 1, 0 }, { 0,-1 }, {-1,-1 } }, 
   { { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1,-1 } } } }; 

   public void start() 
   { 
      StillRunning = true; 
      (new Thread(this)).start(); 
   } 

   public void stop() 
   { 
      StillRunning = false; 
   } 

   public void init() 
   { 
       
      setFont(new Font("TimesRoman", Font.BOLD, 20)); 
      setBackground(new Color(0, 0, 0)); 
   } 

   public void run() 
   { // Keeps the game ticking over. 
      int i; 
      //control the game speed. flyfan 

      while (StillRunning)  //flyfan 
      { 
         try { // Controls game speed. 
            Thread.sleep(delay); 
         } 
         catch (InterruptedException e) {} 

         if (!StillRunning) break; 

         if (boardinitialized) 
            { 
               if (Paused) continue; 
               if (CurrentBlockColour == 0) 
               { // Make a new piece. 
                  if (NextBlockColour == 0) makeNewPiece(); 
                  CurrentBlockColour = NextBlockColour; 
                  CurrentBlockX = NextBlockX; 
                  CurrentBlockY = NextBlockY; 
                  CurrentBlockShape = NextBlockShape; 
                  CurrentBlockAngle = NextBlockAngle; 
                  makeNewPiece(); 
               } 
               else 
               { // Drop the current piece by one place. 
               i = -1; 
               while (i++ < 3) 
               if (CurrentBlockY + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][1] >= 26|| 
               BoardArray[CurrentBlockX + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][0]][CurrentBlockY + 1 + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][1]] != 0) 
               { // Piece hits bottom/some other piece. 
                  i = -1; 
                  while (i++ < 3) 
                  { // Store piece on Board. 
                  BoardArray[CurrentBlockX + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][0]][CurrentBlockY + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][1]] = CurrentBlockColour; 
                  if (CurrentBlockY + BlockInfo[CurrentBlockShape][CurrentBlockAngle][i][1] < 3) 
                     { 
                        Paused = true; 
                        GameOver = true; 
                        forceredraw = true; 
                     } 
                  } 

                  CheckRow(); 
    
                  score += 10; 
                  getParent().action(new Event(this, score, null), this); 
                  if (delay > 80) delay -= 2; 
                  CurrentBlockColour = 0; // Get new piece next turn. 
                  LastX = LastY = LastAngle = -1; // Don't delete current piece on next dopaint. 
                  forceredraw = true; 
                  break; 
               } 

               CurrentBlockY++; 
            } 

            dopaint(); 
         } // end----if(boardinitialized) 
         else 
         repaint(); 
      } 
   } 

   public void CheckRow() 
   { // Looks at all the rows and deletes full ones. 
      int i, row = 27, colour = 0, j; 

      while (row-- > 0) 
      { 
         i = -1; 

         while (i++ < 9) 
         { 
         if (BoardArray[i][row] == 0) 
            { 
               i = 99; 
               break; 
            } 

            if (i == 0) 
            colour = BoardArray[i][row]; 
            else 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
人人超碰91尤物精品国产| 欧美成人精品1314www| 国产在线视频一区二区| 亚洲一区二三区| 午夜精品一区在线观看| 亚洲成人av电影在线| 亚洲国产aⅴ成人精品无吗| 欧美精品乱码久久久久久按摩| 蜜桃视频在线一区| 久久久久久久综合色一本| 欧美精品一区男女天堂| 久久久亚洲精品石原莉奈| 国产视频一区二区三区在线观看| 欧美精品一区二区三区蜜臀| www久久精品| 亚洲人成网站在线| 悠悠色在线精品| 日韩精品1区2区3区| 国产美女视频91| 国产成人高清视频| 色综合天天综合网国产成人综合天| 99re成人精品视频| 欧美美女一区二区在线观看| 日韩免费福利电影在线观看| 中文字幕av一区 二区| 亚洲综合色成人| 男女性色大片免费观看一区二区| 欧美人与z0zoxxxx视频| 中文字幕成人在线观看| 亚洲精品伦理在线| 亚洲成人7777| 国内精品嫩模私拍在线| 91在线免费看| 日韩亚洲欧美高清| 亚洲日本护士毛茸茸| 亚洲1区2区3区视频| 国产99一区视频免费| 在线观看视频一区| 国产午夜精品一区二区 | 日韩欧美国产三级电影视频| 国产日韩av一区| 一区二区三区美女视频| 国产一区二区三区免费看| 欧洲国产伦久久久久久久| 久久成人麻豆午夜电影| 国产91在线观看| 欧美日韩国产大片| 国产精品入口麻豆九色| 精品中文字幕一区二区小辣椒| 色哟哟欧美精品| 精品国产乱码久久久久久图片 | 亚洲色图都市小说| 国产在线播放一区| 欧美精品 国产精品| 亚洲同性gay激情无套| 国产一二精品视频| 日韩欧美在线网站| 香蕉久久夜色精品国产使用方法| av在线不卡网| 中文字幕av一区二区三区高| 韩国欧美一区二区| 精品国产精品网麻豆系列| 欧美成人激情免费网| 欧美伊人精品成人久久综合97| 中文字幕国产精品一区二区| 成人国产一区二区三区精品| 欧美v日韩v国产v| 日本中文在线一区| 欧美年轻男男videosbes| 亚洲国产精品视频| 色婷婷国产精品| 亚洲欧美日韩国产另类专区| 97久久超碰精品国产| 日韩一区欧美小说| 成人黄色网址在线观看| 欧美极品美女视频| www.欧美.com| 亚洲日韩欧美一区二区在线| 91欧美激情一区二区三区成人| 亚洲欧美在线视频| 99精品热视频| 亚洲精品久久久蜜桃| 91黄视频在线观看| 五月天精品一区二区三区| 51午夜精品国产| 免费人成在线不卡| 久久一区二区三区四区| 成人免费va视频| 亚洲色图制服丝袜| 欧美三电影在线| 日精品一区二区三区| 欧美一卡二卡在线| 国产精品亚洲一区二区三区在线 | 成人黄色小视频在线观看| 国产精品视频麻豆| 在线亚洲人成电影网站色www| 亚洲免费在线观看视频| 欧美日韩五月天| 日本不卡一区二区三区高清视频| 亚洲人xxxx| 欧美一三区三区四区免费在线看| 激情综合色播激情啊| 欧美高清在线一区| 欧美精品粉嫩高潮一区二区| 久久精品国产精品青草| 中文久久乱码一区二区| 欧美日韩一区在线观看| 精品在线你懂的| 一区二区高清在线| 精品处破学生在线二十三| fc2成人免费人成在线观看播放| 午夜婷婷国产麻豆精品| 69堂成人精品免费视频| 亚洲精品成人a在线观看| 91国偷自产一区二区三区成为亚洲经典 | 欧美三级视频在线| 日本欧美久久久久免费播放网| 久久久无码精品亚洲日韩按摩| 91毛片在线观看| 久久精品国产99国产| 国产精品视频一二| 欧美精品123区| 91美女片黄在线观看| 麻豆精品在线看| 亚洲人被黑人高潮完整版| 国产传媒欧美日韩成人| 偷拍与自拍一区| 欧洲精品一区二区| 国产精品综合一区二区三区| 丝袜美腿亚洲一区二区图片| 久久久欧美精品sm网站| 欧美精品日韩精品| 91色视频在线| 成人影视亚洲图片在线| 六月婷婷色综合| 亚洲成人激情社区| 亚洲图片一区二区| 一区视频在线播放| 国产亚洲成年网址在线观看| 欧美一区二区视频网站| 欧洲激情一区二区| 色婷婷亚洲一区二区三区| 国产一区二区三区高清播放| 天天影视涩香欲综合网| 欧美亚洲免费在线一区| 日韩精品一区二区三区四区视频| 日韩欧美久久久| 在线不卡一区二区| 日日夜夜免费精品| 亚洲视频在线一区二区| 9191久久久久久久久久久| 日韩制服丝袜av| 国产日韩欧美激情| 91精品一区二区三区在线观看| 亚洲一级二级三级| 国产日韩影视精品| 一区二区三区四区av| 国产一区二区视频在线播放| 精品亚洲免费视频| 国内精品免费在线观看| 日韩在线卡一卡二| 国模一区二区三区白浆| 国产成人亚洲综合a∨婷婷| 久久99精品国产.久久久久| 久久国产精品第一页| 9i在线看片成人免费| 欧洲一区在线观看| 欧美精品第1页| 欧美刺激午夜性久久久久久久| 欧美一区二区女人| 日韩精品专区在线影院观看 | 9色porny自拍视频一区二区| 国产毛片一区二区| 在线观看国产91| 日韩欧美你懂的| 亚洲电影第三页| 欧美亚洲一区三区| 91蜜桃婷婷狠狠久久综合9色| voyeur盗摄精品| 色网综合在线观看| 欧美日韩精品一区二区在线播放| 91精品婷婷国产综合久久性色| 欧美一级欧美三级在线观看 | 亚洲丶国产丶欧美一区二区三区| 亚洲bdsm女犯bdsm网站| 国内精品伊人久久久久av一坑 | 欧美日韩国产一区| 精品国产一区二区三区av性色| 国产女人18毛片水真多成人如厕 | 久久99蜜桃精品| 国产凹凸在线观看一区二区| 色综合久久中文字幕| 日韩片之四级片| 亚洲欧美在线另类| 美女免费视频一区二区| 91蜜桃在线观看| 欧美一级免费观看| 亚洲图片另类小说| 精品一二线国产| 欧美日韩精品一区二区三区蜜桃 |