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

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

?? pushpuzzlecanvas.java

?? 本文件是關于手機上的推箱子的源代碼; 沒辦法下載不了。只能傳了。
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
	int bheight = board.getHeight();	int w = getWidth();	int h = getHeight();	// height of Canvas	cell = ((h-14) / bheight < w / bwidth) ? (h-14) / bheight : w / bwidth;	// Create a mutable image and initialize	themeImage = Image.createImage(cell * 5, cell);	Graphics g = themeImage.getGraphics();	g.setColor(GroundColor0);	g.fillRect((TILE_GROUND - 1 ) * cell, 0, cell*TILE_PUSHER, cell);	g.setColor(PacketColor0);	g.fillRect((TILE_PACKET- 1 ) * cell + 1, 1, cell - 2, cell - 2);	g.setColor(StoreColor0);	g.drawRect((TILE_STORE- 1 ) * cell + 1, 1, cell - 2, cell - 2);	g.setColor(WallColor0);	g.fillRect((TILE_WALL- 1 ) * cell, 0, cell, cell);	g.setColor(PusherColor0);	g.fillArc((TILE_PUSHER- 1 ) * cell, 0, cell, cell, 0, 360);    }    /**     * Setup the theme by reading the images and setting up     * the sprite and picking the tile size.     * Uses the current theme index.     * If the image with the current index can't be found     * retry with theme = 0.     * @param image containing all the frames used for the board.     */    private void setupTheme() {	if (sprite != null) {	    layers.remove(sprite);	    sprite = null;	}	if (theme > 0) {	    try {		StringBuffer name =		    new StringBuffer("/example/pushpuzzle/images/Theme-");		name.append(theme);		name.append(".png");		themeImage = Image.createImage(name.toString());		// Cells are square using the minimum of the width and height		int h = themeImage.getHeight();		int w = themeImage.getWidth();		cell = (w < h) ? w : h;	    } catch (IOException e) {		theme = 0;		setupTheme0();	    }	} else {	    setupTheme0();	}	sprite = new Sprite(themeImage, cell, cell);	sprite.defineReferencePixel(cell/2, cell/2);	int seq[] = new int[] {TILE_PUSHER-1};	sprite.setFrameSequence(seq);	layers.insert(sprite, 0);    }    /**     * Return the Screen to display scores.     * It returns a screen with the current scores.     * @return a screen initialized with the current score information.     */    public Screen getScoreScreen() {	Form scoreForm = null; // Temp until form can do setItem	int currPushes = board.getPushes();	int bestPushes = score.getPushes();	int currMoves = board.getMoves();	int bestMoves = score.getMoves();	boolean newbest = solved &&	    (bestPushes == 0 || currPushes < bestPushes);	scoreForm = new Form(null);	scoreForm.append(new StringItem(            newbest ? "New Best:\n" : "Current:\n",             currPushes + " pushes\n" +             currMoves  + " moves"));	scoreForm.append(new StringItem(            newbest ? "Old Best:\n" : "Best:\n",            bestPushes + " pushes\n" +             bestMoves  + " moves"));	String title = "Scores";	if (newbest) {	    title = "Congratulations";	}	scoreForm.setTitle(title);	return scoreForm;    }    /**     * Handle a repeated arrow keys as though it were another press.     * @param keyCode the key pressed.     */    protected void keyRepeated(int keyCode) {        int action = getGameAction(keyCode);        switch (action) {        case Canvas.LEFT:        case Canvas.RIGHT:        case Canvas.UP:        case Canvas.DOWN:            keyPressed(keyCode);	    break;        default:            break;        }    }    /**     * Handle a single key event.     * The LEFT, RIGHT, UP, and DOWN keys are used to     * move the pusher within the Board.     * Other keys are ignored and have no effect.     * Repaint the screen on every action key.     */    protected void keyPressed(int keyCode) {        boolean newlySolved = false;	// Protect the data from changing during painting.	synchronized (board) {	    cancelTo();	    int action = getGameAction(keyCode);	    int move = 0;	    switch (action) { 	    case Canvas.LEFT:		move = Board.LEFT;		break;	    case Canvas.RIGHT:		move = Board.RIGHT;		break;	    case Canvas.DOWN:		move = Board.DOWN;		break;	    case Canvas.UP:		move = Board.UP;		break;		// case 0: // Ignore keycode that don't map to actions.	    default:		return;	    }	    // Tell the board to move the piece	    int stored = board.getStored();	    int dir = board.move(move);	    if (stored < board.getStored()) {		// Play a note if a packet hit the spot.		play(storedTune);	    }	    int pos = board.getPusherLocation();	    updateTilesNear(pos, dir);	    updateSprite(dir);	} // End of synchronization on the Board.    }        /**     * Update the scores for the current level if it has     * been solved and the scores are better than before.     */    private void updateScores() {	if (!solved)	    return;	int sp = score.getPushes();	int bp = board.getPushes();	int bm = board.getMoves();	/*	 * Update the scores.  If the score for this level is lower	 * than the last recorded score save the lower scores.	 */	if (sp == 0 || bp < sp) {	    score.setLevelScore(bp, bm);	}    }    /**     * Cancel the animation.     */    private void cancelTo() {	targetx = -1;	targety = -1;    }    /**     * Called when the pointer is pressed.      * Record the target for the pusher.     * @param x location in the Canvas     * @param y location in the Canvas     */    protected void pointerPressed(int x, int y) {	targetx = (x - tiles.getX()) / cell;	targety = (y - tiles.getY()) / cell;    }    /**     * Add a listener to notify when the level is solved.     * The listener is send a List.SELECT_COMMAND when the     * level is solved.     * @param l the object implementing interface CommandListener     */    public void setCommandListener(CommandListener l) {	super.setCommandListener(l);        listener = l;    }    /**     * Update the Sprite location from the board supplied position     * @param dir the sprite is moving     */    private void updateSprite(int dir) {	int loc = board.getPusherLocation();	int x = (loc & 0x7fff) * cell;	int y = ((loc >> 16) & 0x7fff) * cell;	// Update sprite location	sprite.setPosition(tiles.getX() + x, tiles.getY() + y);	dir = Board.RIGHT;	// BUG:  Graphics.drawRegion doesn't do xofrm	switch (dir & 0x03) {	case Board.LEFT:	    sprite.setTransform(Sprite.TRANS_ROT180);	    break;	case Board.UP:	    sprite.setTransform(Sprite.TRANS_ROT90);	    break;	case Board.DOWN:	    sprite.setTransform(Sprite.TRANS_ROT270);	    break;	default:	    sprite.setTransform(Sprite.TRANS_NONE);	    break;	}    }    /**     * Queue a repaint for an area around the specified location.     * @param loc an encoded location from Board.getPusherLocation     * @param dir that the pusher moved and flag if it pushed a packet     */    void updateTilesNear(int loc, int dir) {	int x = loc & 0x7fff;	int y = (loc >> 16) & 0x7fff;	// Update cells if any were moved	if (dir >= 0 && ((dir & Board.MOVEPACKET) != 0)) {	    updateTile(x, y);	    updateTile(x+1, y);	    updateTile(x-1, y);	    updateTile(x, y+1);	    updateTile(x, y-1);	}    }    /**     * Paint the contents of the Canvas.     * The clip rectangle of the canvas is retrieved and used     * to determine which cells of the board should be repainted.     * @param g Graphics context to paint to.     */    public void paint(Graphics g) {	flushGraphics();    }    /**     * The canvas is being displayed.     * Stop the event handling and animation thread.     */    protected void showNotify() {	thread = new Thread(this);	thread.start();    }    /**     * The canvas is being removed from the screen.     * Stop the event handling and animation thread.     */    protected void hideNotify() {	thread = null;    }    /**     * The main event processor. Events are polled and     * actions taken based on the directional events.     */    public void run() {	Graphics g = getGraphics(); // Of the buffered screen image        Thread mythread = Thread.currentThread();	// Loop handling events	while (mythread == thread) {	    try { // Start of exception handler		boolean newlySolved = false;		if (!solved && board.solved()) {		    newlySolved = solved = true;		    play(solvedTune);		}		if (newlySolved && listener != null) {		    listener.commandAction(List.SELECT_COMMAND, this);		}				if (targetx >= 0 && targety >= 0) {		    int dir = board.runTo(targetx, targety, 1);		    int pos = board.getPusherLocation();		    if (dir < 0) {			targetx = targety = -1;	// Cancel target		    } else {			updateTilesNear(pos, dir);			updateSprite(dir);		    }		}		// Check that the pusher is not to close to the edge		int loc = board.getPusherLocation();		int x = (loc & 0x7fff) * cell;		int y = ((loc >> 16) & 0x7fff) * cell;				int lx = tiles.getX();		int ly = tiles.getY();				int panScale = cell / 4;		if (panScale < 1)		    panScale = 1;		// If the sprite is too near the edge (or off) pan		if (lx + x > width - cell - cell ) {		    tiles.move(-panScale, 0);		    sprite.move(-panScale, 0);		}		if (lx + x < cell) {		    tiles.move(panScale, 0);		    sprite.move(panScale, 0);		}		if (ly + y > height - cell - cell) {		    tiles.move(0, -panScale);		    sprite.move(0, -panScale);		}		if (ly + y < cell) {		    tiles.move(0, panScale);		    sprite.move(0, panScale);		}		// Draw all the layers and flush		layers.paint(g, 0, 0);		if (mythread == thread) {		    flushGraphics();		}		// g.drawString("PushPuzzle Level " + level, 0, height,		//			     Graphics.BOTTOM|Graphics.LEFT);		try {		    mythread.sleep(PanRate);		} catch (java.lang.InterruptedException e) {		    // Ignore		}	    } catch (Exception e) {		e.printStackTrace();	    }	}    }    /**     * Play the simple tune supplied.     */    void play(byte[] tune) {	try {	    if (tonePlayer == null) {		// First time open the tonePlayer		tonePlayer = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);		tonePlayer.realize();		toneControl = (ToneControl)tonePlayer.getControl("javax.microedition.media.control.ToneControl");	    }	    tonePlayer.deallocate();	    toneControl.setSequence(tune);	    tonePlayer.start();	} catch (Exception ex){	    System.out.println(ex.getMessage());	}    }    /*     * Close the tune player and release resources.     */    void closePlayer() {	if ( tonePlayer != null ) {	    toneControl = null;	    tonePlayer.close();	    tonePlayer = null;	}    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品专区在线影院重磅| 亚洲另类中文字| 岛国av在线一区| 亚洲午夜羞羞片| 欧美tickling网站挠脚心| 色哟哟一区二区| 国产乱码精品1区2区3区| 另类小说图片综合网| 在线观看不卡一区| 国产精品免费丝袜| 黄色日韩网站视频| 欧美va天堂va视频va在线| 亚欧色一区w666天堂| 欧美三级电影在线看| 亚洲午夜电影在线观看| 成人精品在线视频观看| 国产精品你懂的在线| 国内成人免费视频| 中文字幕欧美日韩一区| 国产电影一区二区三区| 亚洲欧美在线视频| 色婷婷av一区二区三区之一色屋| 亚洲乱码国产乱码精品精可以看 | 国产精品卡一卡二卡三| 久久99久久精品| 亚洲精品一区二区三区蜜桃下载 | 精品电影一区二区| 日韩电影网1区2区| 亚洲欧美日韩国产中文在线| 午夜视频在线观看一区二区| 成人黄色网址在线观看| 亚洲综合自拍偷拍| 婷婷开心激情综合| 亚洲欧洲国产专区| 99精品久久只有精品| 成人免费看片app下载| 国内一区二区在线| 国产裸体歌舞团一区二区| 久久99精品久久只有精品| 久久精品久久综合| 国产剧情一区在线| 国产不卡一区视频| 日韩成人午夜电影| 亚洲毛片av在线| 欧美一二三区在线| 99久久精品免费看国产 | 国产91精品精华液一区二区三区 | 中文字幕一区免费在线观看| 在线免费观看不卡av| 国产一区二区三区精品视频| 亚洲午夜久久久久| 久久亚区不卡日本| 精品免费99久久| 欧美日韩久久久| 91久久国产最好的精华液| 国产美女一区二区三区| 九九**精品视频免费播放| 夜色激情一区二区| 伊人性伊人情综合网| 日韩美女啊v在线免费观看| 久久精品亚洲麻豆av一区二区| 欧美一级高清片| 欧美高清视频不卡网| 91免费观看视频在线| 日本二三区不卡| 麻豆国产精品777777在线| 爽爽淫人综合网网站| 亚洲午夜久久久久| 亚洲女同一区二区| 欧美一区二区二区| 欧美日韩国产高清一区二区三区| 欧美一级理论片| 免费高清成人在线| 麻豆极品一区二区三区| 免费亚洲电影在线| 风间由美一区二区三区在线观看 | 亚洲欧洲一区二区在线播放| 一区二区欧美视频| 国产欧美日韩激情| 欧美国产一区视频在线观看| 国产精品激情偷乱一区二区∴| 国产精品免费视频网站| 亚洲成人手机在线| 久久精品国产网站| 成人免费av网站| 欧洲一区二区av| 国产精品灌醉下药二区| 亚洲激情五月婷婷| 日韩精品欧美精品| 国产精品亚洲午夜一区二区三区 | 精品蜜桃在线看| 国产精品美女久久久久久久网站| 五月天久久比比资源色| 国产精品一色哟哟哟| 欧美系列亚洲系列| 欧美极品少妇xxxxⅹ高跟鞋 | 不卡av免费在线观看| 在线免费视频一区二区| 久久伊99综合婷婷久久伊| 亚洲精选视频免费看| 国产不卡在线一区| 欧美裸体bbwbbwbbw| 亚洲婷婷综合久久一本伊一区| 久热成人在线视频| 国产精品羞羞答答xxdd| 国产精品美日韩| 91丨porny丨国产| 专区另类欧美日韩| 中文字幕av免费专区久久| 日本一区二区高清| 精品综合久久久久久8888| 欧美日韩另类国产亚洲欧美一级| 在线一区二区观看| 国产精品亚洲а∨天堂免在线| 偷拍一区二区三区| 亚洲午夜精品一区二区三区他趣| 国产白丝精品91爽爽久久| 精品欧美一区二区在线观看 | 亚洲国产欧美另类丝袜| 白白色 亚洲乱淫| 日本一区二区三区四区| 久久99国产精品尤物| 色香色香欲天天天影视综合网 | 国产米奇在线777精品观看| 欧美一区二区日韩| 欧美a一区二区| 精品美女一区二区| 激情综合五月婷婷| 中文字幕一区二区三区蜜月| 国产精品一区二区在线看| 国产欧美日韩综合| 91亚洲精品久久久蜜桃网站 | 91国偷自产一区二区使用方法| 国产精品电影院| 精品视频在线免费看| 肉丝袜脚交视频一区二区| 国产视频一区在线观看| 色婷婷激情一区二区三区| 日韩和的一区二区| 久久网站最新地址| 色国产精品一区在线观看| 五月激情六月综合| 久久久99久久精品欧美| 91色.com| 国产91精品一区二区麻豆亚洲| 国产精品久久免费看| 91精品久久久久久久99蜜桃| 99久久99久久精品国产片果冻| 亚洲国产精品传媒在线观看| 日韩三级伦理片妻子的秘密按摩| 韩国成人在线视频| 国产黄色精品网站| 亚洲成av人片在线观看无码| 成人avav影音| 九九视频精品免费| 国产ts人妖一区二区| 9191国产精品| 精品国产一区二区三区四区四| 中国色在线观看另类| 99久久精品免费精品国产| 一区二区三区在线播放| 在线不卡免费av| 国产呦萝稀缺另类资源| 国产精品人人做人人爽人人添| 色狠狠综合天天综合综合| 日韩国产精品久久久| 亚洲精品在线三区| 9l国产精品久久久久麻豆| 亚洲一卡二卡三卡四卡无卡久久 | 亚洲一区二区在线播放相泽 | 色综合久久99| 波多野结衣91| 92精品国产成人观看免费 | 国产日产精品1区| 日韩欧美久久久| 日韩欧美一二三| 久久久久国产精品麻豆ai换脸| 538在线一区二区精品国产| 欧美精品 日韩| 久久伊人蜜桃av一区二区| 欧美精品一区二区三区很污很色的| 91.麻豆视频| 国产人成亚洲第一网站在线播放| 精品久久久久久久人人人人传媒| 日韩欧美中文一区二区| 亚洲精品一区二区三区香蕉| 国产色综合一区| 亚洲日本欧美天堂| 六月婷婷色综合| 国产99精品国产| 欧美日韩一级片在线观看| 91精品国产综合久久久久久久久久 | 中文字幕日韩av资源站| 久久久久国产一区二区三区四区| 91精品国产91久久久久久最新毛片| 欧美制服丝袜第一页| 日韩精品一区二| 在线观看区一区二| 成人短视频下载| 亚洲天堂久久久久久久|