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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? russioncube.txt

?? 這是一個(gè)小的用java語言編寫的俄羅斯方塊源程序
?? TXT
?? 第 1 頁 / 共 2 頁
字號(hào):
/* 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; 
  } 

// **********************************監(jiān)聽各圖端是否有鼠標(biāo)事件**** 

   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 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产视频视频一区| 国产亚洲综合色| 久久99精品一区二区三区 | 日韩不卡手机在线v区| 欧美精品一区在线观看| 91在线观看一区二区| 免费av网站大全久久| 亚洲私人影院在线观看| 日韩女优av电影| 欧美综合久久久| 国产999精品久久久久久绿帽| 一区二区三区**美女毛片| 亚洲国产一区二区a毛片| 欧美va天堂va视频va在线| 91久久人澡人人添人人爽欧美| 九九国产精品视频| 亚欧色一区w666天堂| 中文字幕精品在线不卡| 日韩欧美国产成人一区二区| 91传媒视频在线播放| 国产91精品一区二区麻豆网站 | 亚洲欧美日韩国产手机在线| 精品人在线二区三区| 欧美亚洲综合另类| 99久久99精品久久久久久| 国产酒店精品激情| 美日韩一区二区三区| 亚洲高清在线精品| 亚洲免费观看高清| 中文字幕日韩一区| 久久久久久久网| 日韩欧美一区二区在线视频| 欧美视频在线一区二区三区| jvid福利写真一区二区三区| 国产精品一区二区在线观看不卡| 三级精品在线观看| 亚洲成在人线免费| 亚洲在线视频一区| 亚洲精品免费看| 国产精品白丝在线| 国产精品久久久久久久久晋中| 久久久九九九九| 久久久久久夜精品精品免费| 欧美α欧美αv大片| 日韩一区二区不卡| 日韩一区二区在线观看视频| 4438x成人网最大色成网站| 欧亚洲嫩模精品一区三区| 色综合色综合色综合色综合色综合| 成人免费毛片app| 大桥未久av一区二区三区中文| 国产露脸91国语对白| 国产精品羞羞答答xxdd| 国产精品456| 成人免费视频一区| 97精品国产97久久久久久久久久久久 | 欧美日本一区二区| 欧美精品高清视频| 日韩一级二级三级| 亚洲精品一区二区三区蜜桃下载 | 欧美日韩精品综合在线| 欧美日韩的一区二区| 欧美久久久久中文字幕| 欧美一区二区三区视频免费| 欧美成人激情免费网| 久久久高清一区二区三区| 国产欧美一二三区| 亚洲日本一区二区三区| 亚洲一区二区在线观看视频| 亚洲va欧美va人人爽| 热久久免费视频| 国产一区二区美女诱惑| 懂色一区二区三区免费观看| 成a人片国产精品| 91国偷自产一区二区使用方法| 欧美色爱综合网| 欧美电影免费观看完整版| 久久久亚洲精品一区二区三区| 国产精品婷婷午夜在线观看| 亚洲欧美一区二区三区极速播放| 亚洲福利国产精品| 国产真实乱子伦精品视频| 成人国产免费视频| 欧美男人的天堂一二区| 亚洲激情图片qvod| 青娱乐精品在线视频| 国产一区在线看| 91免费精品国自产拍在线不卡| 欧美视频一区二区三区在线观看| 日韩欧美一二三区| 《视频一区视频二区| 日本怡春院一区二区| 成人国产一区二区三区精品| 欧美精品日韩综合在线| 国产欧美日本一区视频| 午夜久久久影院| 粉嫩av一区二区三区在线播放| 91高清在线观看| 久久久久久99久久久精品网站| 亚洲女人的天堂| 国产在线播精品第三| 91国在线观看| 国产网红主播福利一区二区| 亚洲动漫第一页| 成人av网站免费| 日韩欧美精品在线视频| 亚洲永久免费视频| 国产91富婆露脸刺激对白| 在线播放国产精品二区一二区四区| 欧美经典一区二区三区| 天天综合日日夜夜精品| 99re这里只有精品首页| 久久免费电影网| 日韩二区三区在线观看| 91啦中文在线观看| 国产欧美日韩不卡| 久久精品久久99精品久久| 欧美三级韩国三级日本三斤| 久久99热国产| 欧美在线视频日韩| 综合久久久久久久| 国产aⅴ综合色| 精品播放一区二区| 日韩国产精品久久久久久亚洲| 色狠狠桃花综合| 国产精品国产三级国产专播品爱网| 久久激情综合网| 欧美日本在线观看| 亚洲成人综合在线| 色乱码一区二区三区88| 中文字幕一区免费在线观看| 国产精品一区一区三区| 日韩免费一区二区| 美女高潮久久久| 日韩限制级电影在线观看| 日韩极品在线观看| 欧美日韩高清一区二区三区| 亚洲一区二区三区美女| 91黄色在线观看| 一区二区三区四区不卡在线| 色综合久久久久综合体| 日韩理论片中文av| 99久免费精品视频在线观看| 中文av一区二区| 国产91精品一区二区麻豆网站 | 在线欧美一区二区| 亚洲乱码精品一二三四区日韩在线| 成人免费视频一区| 国产精品三级av在线播放| 成人h版在线观看| 国产精品国产成人国产三级| 成人永久免费视频| 国产精品成人免费精品自在线观看| 成人精品鲁一区一区二区| 欧美极品少妇xxxxⅹ高跟鞋 | 91精品国产91久久久久久最新毛片| 亚洲一区二区三区爽爽爽爽爽| 欧美日韩一区二区三区视频| 亚洲成人免费视| 欧美一区二区成人6969| 久久国产生活片100| 久久久久九九视频| 成人av午夜电影| 伊人色综合久久天天人手人婷| 在线观看国产精品网站| 天堂久久久久va久久久久| 日韩精品一区二区三区蜜臀| 国产一区二区0| 国产精品国产三级国产普通话三级| 99久久精品免费看国产免费软件| 亚洲精品国产一区二区精华液 | 亚洲综合清纯丝袜自拍| 欧美日韩精品一区二区| 美国精品在线观看| 中文字幕av资源一区| 色综合一区二区三区| 午夜精品免费在线| 久久久久久久免费视频了| 91丨porny丨在线| 视频一区二区欧美| 国产清纯美女被跳蛋高潮一区二区久久w| 不卡一区二区三区四区| 亚洲成人动漫在线免费观看| 亚洲精品在线三区| 不卡一区二区三区四区| 天天av天天翘天天综合网 | 91精品国产手机| 国产成人一区在线| 亚洲一区二区免费视频| 久久嫩草精品久久久精品| 91影院在线免费观看| 欧美aaaaaa午夜精品| 综合网在线视频| 欧美成人一级视频| 在线免费观看日韩欧美| 国产黑丝在线一区二区三区| 亚洲小说欧美激情另类| 国产欧美1区2区3区| 91精品中文字幕一区二区三区| 成人久久久精品乱码一区二区三区|