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

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

?? pushpuzzlecanvas.java

?? 本文件是關于手機上的推箱子的源代碼; 沒辦法下載不了。只能傳了。
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * @(#)PushPuzzleCanvas.java	1.5 04/05/20 * * Copyright (c) 1999-2004 Sun Microsystems, Inc. All rights reserved.  * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */package example.pushpuzzle;import java.io.*;import javax.microedition.lcdui.*;import javax.microedition.lcdui.game.*;import javax.microedition.midlet.*;import javax.microedition.media.*;import javax.microedition.media.control.ToneControl;/** * PushPuzzleCanvas displays the game board and handles key events. * The PushPuzzle game logic and algorithms are separated into Board.java. * PushPuzzleCanvas does not setup or use any Commands.  Commands for each * screen and listeners should be setup outside this class. * PushPuzzleCanvas generates a SELECT_COMMAND when the current level  * is solved. Sequencing through screens is done in the PushPuzzle MIDlet. * <p> * PushPuzzleCanvas handles the reading, initialization, and sequencing * of individual puzzle screens. * <p> * PushPuzzleCanvas uses the Score class to restore and save game levels * and scores for each level. To display the scores use getScoreScreen. * It will be initialized with the current scores. * To select a new level use the getLevelScreen and gotoLevel * methods. * <p> * PushPuzzleCanvas handled key events for LEFT, RIGHT, UP, and DOWN to * move the pusher in the game board.  Pointer pressed events * are used to move the pusher to the target location (if possible). * <p> */class PushPuzzleCanvas extends GameCanvas implements Runnable {    /** The current level */    private int level = 1;    /** The current theme index */    private int theme;    /** True if the level has been solved */    private boolean solved;    /** number of pixels per cell (updated by readscreen) */    private int cell = 1;	    /** The width of the canvas */    private int width;    /** The height of the canvas */    private int height;    /** The width of the board */    private int bwidth;    /** The height of the board */    private int bheight;    /** The board containing the location of each packet, ground, walls, etc */    private Board board;    /** The score object */    private Score score;    /** The main MIDlet */    private PushPuzzle pushpuzzle;    /** The Display of this MIDlet */    private Display display;    /** The listener used to report solved events */    private CommandListener listener;    /** The form for score display */    private Form scoreForm;	// form for scores    /** The TextBox to input new level numbers */     private TextBox levelText;	// for input of new level    /** Background color */    private static int groundColor = 0xff8080;    /** The index in the image of the Ground */    public final int TILE_GROUND = 1;    /** The index in the image of the Packet */    public final int TILE_PACKET = 2;    /** The index in the image of the Store */    public final int TILE_STORE = 3;    /** The index in the image of the Wall */    public final int TILE_WALL = 4;    /** The index in the image of the Pusher */    public final int TILE_PUSHER = 5;    /** Background image */    private Image themeImage;    /** Tiles forming the background */    private TiledLayer tiles;    /** The Sprite that is the pusher */    private Sprite sprite;    /** Layer manager */    private LayerManager layers;    /** Thread used for key handling and animation */    private Thread thread;    /** The target cell for runTo */    private int targetx;    /** The target cell for runTo */    private int targety;    /** Pan Rate; number of milliseconds between screen updates */    private static final int PanRate = 50;    /** The Tone player */    private Player tonePlayer;    /** The ToneController */    private ToneControl toneControl;    /** Tune to play when puzzle level is solved. */    private byte[] solvedTune = {	ToneControl.VERSION, 1,	74, 8,	// 1/8 note	75, 8,	73, 8    };    /** Tune to play when a packet enters a store */    private byte[] storedTune = {	ToneControl.VERSION, 1,	50, 8,	// 1/8 note	60, 8,	70, 8    };    /**     * Construct a new canvas     * @param pushpuzzle the main MIDlet     * @param s the score object     */    public PushPuzzleCanvas(PushPuzzle pushpuzzle, Score s) {	super(false);		// Don't suppress key events	this.pushpuzzle = pushpuzzle;	display = Display.getDisplay(pushpuzzle);	score = s;	board = new Board();	layers = new LayerManager();	setupTheme();	targetx = targety = -1;	height = getHeight();	width = getWidth();    }    /**     * Read the previous level number from the score file.     * Read in the level data.     */    public void init() {	// Read the last level; if it can't be found, revert to level 0	theme = score.getTheme();	setupTheme();	level = score.getLevel();	if (!readScreen(level)) {	    level = 0;	    readScreen(level);	}    }	    /**     * Cleanup and destroy.     */    public void destroy() {	hideNotify();    }    /**     * Figure out which set of icons to use based on the colors     */    private void initColors() {	boolean isColor = display.isColor();	int numColors = display.numColors();	if (isColor) {	} else {	    if (numColors > 2) {	    } else {	    }	}    }       /**     * Change themes.     * Cycle to the next index and try it     */    public void changeTheme() {	theme++;	setupTheme();	score.setLevel(level, theme); // save the level and theme	setupTiles();	updateSprite(0);    }    /**     * Undo the last move if possible. Redraw the cell     * the pusher occupies after the undone move and the cells     * in the direction of the original move.     * Here so undo can be triggered by a command.     */    public void undoMove() {	int pos = board.getPusherLocation();	int dir = board.undoMove();	if (dir >= 0) {	    updateTilesNear(pos, dir);	    updateSprite(dir);	}	solved = board.solved();    }    /**     * Restart the current level.     */    public void restartLevel() {	readScreen(level);	solved = false;    }    /**     * Start the next level.     * @param offset of the next level     * @return true if the new level was loaded     */    public boolean nextLevel(int offset) {	updateScores();	// save best scores 	if (level + offset >= 0 && readScreen(level+offset)) {	    level += offset;	    score.setLevel(level, theme);	    solved = false;	    return true;	}	return false;    }    /**     * Get the current level.     * @return the current level.     */    public int getLevel() {	return level;    }    /**     * Get a screen to let the user change the level.     * A simple numeric TextBox will do.     * @return the textbox used to change the level number     */    public Screen getLevelScreen() {	if (levelText == null) {	    levelText = new TextBox("Enter Level",				      Integer.toString(level), // default				      4, TextField.NUMERIC);	} else {	    levelText.setString(Integer.toString(level));	}	return levelText;    }    /**     * Go to the chosen Level.     * @return true if the new level was loaded.     */    public boolean gotoLevel() {	if (levelText != null) {	    String s = levelText.getString();	    int l;           try {               l = Integer.parseInt(s);           } catch (java.lang.NumberFormatException e) {               return false;           }	    updateScores();	    if (l >= 0 && readScreen(l)) {		level = l;		score.setLevel(level, theme);		solved = false;		return true;	    }	}	return false;    }    /**     * Read and setup the next level.     * Opens the resource file with the name "/Screen.<lev>"     * and tells the board to read from the stream.     * <STRONG>Must be called only with the board locked.</STRONG>     * @param lev the level number to read.     * @return true if the reading of the level worked, false otherwise.     */    private boolean readScreen(int lev) {	if (lev <= 0) {	    board.screen0();	// Initialize the default zero screen.	} else {	    InputStream is = null;	    try {		is = getClass().getResourceAsStream(					"/example/pushpuzzle/data/screen."					+ lev);		if (is != null) {		    board.read(is, lev);		    is.close();		} else {		    System.out.println(				   "Could not find the game board for level "				   + lev);		    return false;		}	    } catch (java.io.IOException ex) {		return false;	    }	}	bwidth = board.getWidth();	bheight = board.getHeight();	setupTiles();	updateSprite(0);	return true;    }    /**     * Create the Tiled layer to represent the current board.     */    private void setupTiles() {	if (tiles != null) {	    layers.remove(tiles);	}	// Figure out how many cells are needed to cover canvas.	int w = (width + cell - 1) / cell;	int h = (height + cell - 1) / cell;	tiles = new TiledLayer(w > bwidth ? w : bwidth,			       h > bheight ? h : bheight,			       themeImage, cell, cell);	/** Fill it all with background */	tiles.fillCells(0, 0, w, h, TILE_GROUND);	// Initialize the background tileset	for (int y = 0; y < bheight; y++) {	    for (int x = 0; x < bwidth; x++) {		updateTile(x, y);	    }	}		layers.append(tiles);    }    /**     * Update the tile at the location.     * @param x the offset of the tile to update     * @param y the offset of the tile to update     */    private void updateTile(int x, int y) {	int tile = 0;	byte v = board.get(x, y);	switch (v & ~Board.PUSHER) {	case Board.WALL:	    tile = TILE_WALL;	    break;	case Board.PACKET:	case Board.PACKET | Board.STORE:	    tile = TILE_PACKET;	    break;	case Board.STORE:	    tile = TILE_STORE;	    break;	case Board.GROUND:	default:	    tile = TILE_GROUND;	}	tiles.setCell(x, y, tile);    }    private static final int GroundColor0 = 0xffffff;    private static final int PacketColor0 = 0xff6d00;    private static final int StoreColor0 = 0xb60055;    private static final int WallColor0 = 0x006D55;    private static final int PusherColor0 = 0x6d6dff;    /**     * Setup Theme-0 generated to match screen     * size and board size.     */    private void setupTheme0() {	int bwidth = board.getWidth();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色爱区综合激月婷婷| 日韩免费性生活视频播放| 色一情一伦一子一伦一区| 欧美亚洲综合久久| 久久伊99综合婷婷久久伊| 亚洲图片欧美激情| 日韩主播视频在线| 91黄色免费看| 久久你懂得1024| 日本美女一区二区三区| 99热精品国产| 久久综合久久综合久久综合| 亚洲影视在线播放| 国产精选一区二区三区| 欧美第一区第二区| 一区二区三区免费看视频| 成人性色生活片| 91精品国产91热久久久做人人| 亚洲精品成a人| 丁香一区二区三区| 欧美一区二区啪啪| 日本一区中文字幕| 欧美写真视频网站| 亚洲与欧洲av电影| 不卡高清视频专区| 国产欧美日韩精品一区| 看片网站欧美日韩| 精品视频1区2区3区| 亚洲国产日韩综合久久精品| 成人免费观看男女羞羞视频| 国产亚洲成aⅴ人片在线观看| 午夜精品久久久久久久蜜桃app| 欧美中文字幕一区二区三区 | 日韩午夜激情视频| 亚洲女爱视频在线| 成人18视频在线播放| 综合自拍亚洲综合图不卡区| 国产成人在线色| 国产欧美精品一区| 国产成人综合自拍| 中文子幕无线码一区tr| 国产成人鲁色资源国产91色综 | 成人综合在线观看| 久久久91精品国产一区二区三区| 琪琪久久久久日韩精品| 日韩美女视频在线| 麻豆精品在线播放| 日韩精品一区二区三区视频播放| 免费在线观看一区| 日韩免费高清av| 国产剧情一区在线| 国产亚洲精品aa| 91香蕉视频mp4| 一区二区国产视频| 欧美一级午夜免费电影| 六月丁香婷婷久久| 51精品视频一区二区三区| 老色鬼精品视频在线观看播放| 欧美精品在线观看一区二区| 国产一区高清在线| 欧美激情在线免费观看| 国产乱子伦一区二区三区国色天香| 国产清纯白嫩初高生在线观看91| 国产精品资源在线| 亚洲综合一区二区精品导航| 欧美三级在线播放| 国产成人精品午夜视频免费| 国产精品盗摄一区二区三区| 北条麻妃国产九九精品视频| 一卡二卡三卡日韩欧美| 日韩一级高清毛片| 国产a久久麻豆| 亚洲成人综合网站| 国产精品色一区二区三区| 91色在线porny| 国产在线麻豆精品观看| 亚洲精品第1页| 色综合夜色一区| 国产九色sp调教91| 亚洲精品乱码久久久久| 精品国产91洋老外米糕| 成人动漫在线一区| 蜜桃av噜噜一区二区三区小说| 久久久99精品久久| 欧美一级专区免费大片| 成人免费av网站| 亚洲综合色区另类av| 久久精品网站免费观看| 欧美日韩电影一区| 99在线精品免费| 奇米精品一区二区三区在线观看 | 久久久99久久| 欧美性猛交xxxxxxxx| 国产a级毛片一区| 亚洲成av人影院| 亚洲色图视频网站| 欧美一级黄色大片| 国产成人午夜高潮毛片| 激情五月婷婷综合网| 午夜精品久久久久| 一区二区三区在线观看网站| 国产亚洲婷婷免费| 亚洲精品一区二区三区蜜桃下载| 欧美写真视频网站| 欧美日韩一区在线| 成人动漫av在线| 成人黄页毛片网站| 精一区二区三区| 久久99精品久久久久婷婷| 亚洲综合丁香婷婷六月香| 欧美国产97人人爽人人喊| 精品美女一区二区| 欧美日韩高清一区二区不卡| 在线精品观看国产| 91小视频在线| 欧美性xxxxxxxx| 色婷婷综合久久| 欧美三级电影在线看| 99精品桃花视频在线观看| 亚洲va中文字幕| 亚洲在线视频免费观看| 国产日韩高清在线| 《视频一区视频二区| 国产欧美日韩综合| 亚洲欧美日韩国产成人精品影院| 日本一区二区三区国色天香| 中文字幕一区免费在线观看| 国产欧美日韩卡一| 亚洲欧美日韩国产手机在线 | 亚洲欧美一区二区三区国产精品| 欧洲视频一区二区| 91精品久久久久久蜜臀| 欧美日韩国产一级片| 日韩一二三四区| 日韩一级大片在线观看| 国产日产亚洲精品系列| 久久精品男人的天堂| 亚洲欧美成人一区二区三区| 日韩美女视频19| 亚洲福利视频一区二区| 日韩精品电影一区亚洲| 麻豆精品视频在线观看视频| 蜜臀久久99精品久久久久久9 | 午夜激情综合网| 日韩精品免费专区| 午夜精品久久久久久久久久| 国内精品国产三级国产a久久| 国产成人亚洲综合a∨婷婷| 99国产精品久久久久久久久久久| 色一情一伦一子一伦一区| 3atv在线一区二区三区| 欧美精品一区二区三区久久久| 中文av字幕一区| 亚洲综合色噜噜狠狠| 狠狠色丁香久久婷婷综| 成人动漫一区二区在线| 欧美视频自拍偷拍| 欧美成人乱码一区二区三区| 欧美日韩dvd在线观看| 欧美大尺度电影在线| 国产日韩欧美在线一区| 一区二区成人在线| 日韩成人午夜电影| 国产精品1区2区3区在线观看| 色哟哟国产精品| 欧美成人艳星乳罩| 国产精品久久久久国产精品日日| 日韩伦理电影网| 久久精品免费看| 欧洲一区在线观看| 久久久777精品电影网影网 | 日韩欧美亚洲一区二区| 日本一区二区三区高清不卡| 日本va欧美va精品| 99久久久精品免费观看国产蜜| 日韩欧美成人一区| 亚洲精品久久久蜜桃| 国产成+人+日韩+欧美+亚洲| 欧美日韩一区二区在线观看 | 国产精品中文字幕一区二区三区| eeuss鲁一区二区三区| 精品国产一区二区亚洲人成毛片 | 欧美久久一区二区| 中日韩av电影| 国产大片一区二区| 91精品国产色综合久久不卡电影 | 国产午夜精品在线观看| 亚洲午夜羞羞片| 在线观看精品一区| 国产欧美综合在线观看第十页| 蓝色福利精品导航| 欧美三级电影在线观看| 亚洲最大成人综合| 成人丝袜高跟foot| 国产欧美日韩亚州综合| 另类小说色综合网站| 日韩一级二级三级精品视频| 亚洲午夜久久久久| 欧美综合欧美视频| 又紧又大又爽精品一区二区|