国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

類似衛星掃描效果

2019-11-18 16:06:22
字體:
來源:轉載
供稿:網友

/*
Wireless java 2nd edition
Jonathan Knudsen
Publisher: APRess
ISBN: 1590590775
*/

import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
import javax.microedition.midlet.*;

public class SweepGame extends MIDlet {
  public void startApp() {
    final SweepGameCanvas sweeper = new SweepGameCanvas();
    sweeper.start();
   
    sweeper.addCommand(new Command("Exit", Command.EXIT, 0));
    sweeper.setCommandListener(new CommandListener() {
      public void commandAction(Command c, Displayable s) {
        sweeper.stop();
        notifyDestroyed();
      }
    });
   
    Display.getDisplay(this).setCurrent(sweeper);
  }
 
  public void pauseApp() {}

  public void destroyApp(boolean unconditional) {}
}

class SweepGameCanvas extends GameCanvas implements Runnable {
  private boolean mTrUCking;
  private int mTheta;
  private int mBorder;
  private int mDelay;
 
  public SweepGameCanvas() {
    super(true);
    mTheta = 0;
    mBorder = 10;
    mDelay = 50;
  }
 
  public void start() {
    mTrucking = true;
    Thread t = new Thread(this);
    t.start();
  }
 
  public void stop() {
    mTrucking = false;
  }
   
  public void render(Graphics g) {
    int width = getWidth();
    int height = getHeight();
   
    // Clear the Canvas.
    g.setGrayScale(255);
    g.fillRect(0, 0, width - 1, height - 1);
   
    int x = mBorder;
    int y = mBorder;
    int w = width - mBorder * 2;
    int h = height - mBorder * 2;
    for (int i = 0; i < 8; i++) {
      g.setGrayScale((8 - i) * 32 - 16);
      g.fillArc(x, y, w, h, mTheta + i * 10, 10);
      g.fillArc(x, y, w, h, (mTheta + 180) % 360 + i * 10, 10);
    }
  }
 
  public void run() {
    Graphics g = getGraphics();
    while (mTrucking) {
      mTheta = (mTheta + 1) % 360;
      render(g);
      flushGraphics();
      try { Thread.sleep(mDelay); }
      catch (InterruptedException ie) {}
    }
  }
}類似衛星掃描效果 類似衛星掃描效果


(出處:http://www.survivalescaperooms.com)



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 工布江达县| 温宿县| 南雄市| 广河县| 惠安县| 七台河市| 霍州市| 公安县| 化州市| 琼结县| 思茅市| 新建县| 额敏县| 贡山| 崇州市| 奉新县| 大同县| 健康| 正蓝旗| 孙吴县| 太谷县| 商洛市| 嘉黎县| 德化县| 克什克腾旗| 谢通门县| 沙湾县| 平阳县| 休宁县| 府谷县| 平南县| 辉县市| 大宁县| 丰镇市| 东宁县| 宁河县| 法库县| 望城县| 邢台市| 南和县| 博乐市|