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

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

?? board.java

?? J2ME斜45度游戲引擎
?? JAVA
字號:
package isoj2me;import java.util.*;import javax.microedition.lcdui.*;/** * <p> * isoj2me: Board * </p> * <p> * This is the main class. It manages a Board where you can add, remove and move * Characters and Items. It manages Maps too. This class perform the draw method * to paint the Board on the device * </p> * <p> * Copyright: Copyright (c) 2005 * </p> * <p> * License: Lesser GPL (http://www.gnu.org) * </p> * <p> * Company: <a href=http://www.mondonerd.com target="_blank">Mondonerd.com </a> * </p> *  * @author Massimo Maria Avvisati * @version 0.5b */public class Board {	public Map map;	public static Hashtable tiles = new Hashtable(20);	private int tileWidth, tileHeight;	private Hashtable charactersPositions = new Hashtable(20);	private Hashtable itemsPositions = new Hashtable(20);	public Hashtable characters = new Hashtable();	public Hashtable items = new Hashtable();	public String tileSet = "";	/**	 * Constructor. The tileset basic name will be an empty string.	 */	public Board() {	}	/**	 * Constructor. The tileset basic name will be tileSet and it will be used	 * when loading tiles image files.	 * 	 * @param tileSet	 *                   basic name for tile files	 */	public Board(String tileSet) {		this.tileSet = tileSet;	}	/**	 * Add a Character to the Board.	 * 	 * @param c	 *                   Character object to add	 */	public void putCharacter(isoj2me.Character c) {		charactersPositions.put(c.x + "_" + c.y + "_" + c.z, c);		characters.put(c.name, c);	}	/**	 * Create and then add a Character to the Board.	 * 	 * @param name	 *                   name of the Character	 * @param x	 *                   x	 * @param y	 *                   y	 * @param z	 *                   z	 */	public void putCharacter(String name, int x, int y, int z) {		isoj2me.Character c = new isoj2me.Character(name, x, y, z);		charactersPositions.put(x + "_" + y + "_" + z, c);		characters.put(c.name, c);	}	/**	 * Add an Item to the Board	 * 	 * @param i	 *                   Item object to add	 */	public void putItem(isoj2me.Item i) {		itemsPositions.put(i.x + "_" + i.y + "_" + i.z, i);		items.put(i.name, i);	}	/**	 * Create and then add an Item to the Board.	 * 	 * @param name	 *                   name of the Item	 * @param x	 *                   x	 * @param y	 *                   y	 * @param z	 *                   z	 */	public void putItem(String name, int x, int y, int z) {		isoj2me.Item i = new isoj2me.Item(name, x, y, z);		itemsPositions.put(x + "_" + y + "_" + z, i);		items.put(i.name, i);	}	/**	 * Remove a Character from the Board	 * 	 * @param c	 *                   Character object to remove	 */	public void removeCharacter(isoj2me.Character c) {		charactersPositions.remove(c.x + "_" + c.y + "_" + c.z);		characters.remove(c.name);	}	/**	 * Remove an Item from the Board	 * 	 * @param i	 *                   Item object to remove	 */	public void removeItem(isoj2me.Item i) {		itemsPositions.remove(i.x + "_" + i.y + "_" + i.z);		items.remove(i.name);	}	/**	 * If there is a Character in the x, y, z position of the Board it returns	 * its name. Return null if there is no character.	 * 	 * @param x	 *                   x	 * @param y	 *                   y	 * @param z	 *                   z	 * @return Character name	 */	public String isCharacter(int x, int y, int z) {		String result = null;		if (charactersPositions.containsKey(x + "_" + y + "_" + z)) {			result = charactersPositions.get(x + "_" + y + "_" + z).toString();		}		return result;	}	/**	 * If there is a Item in the x, y, z position of the Board it returns its	 * name. Return null if there is no item.	 * 	 * @param x	 *                   x	 * @param y	 *                   y	 * @param z	 *                   z	 * @return Item name	 */	public String isItem(int x, int y, int z) {		String result = null;		if (itemsPositions.containsKey(x + "_" + y + "_" + z)) {			result = itemsPositions.get(x + "_" + y + "_" + z).toString();		}		return result;	}	/**	 * Move a Character on the Board	 * 	 * @param c	 *                   Character to move	 * @param oldX	 *                   old x	 * @param oldY	 *                   old y	 * @param oldZ	 *                   old z	 * @param newX	 *                   new x	 * @param newY	 *                   new y	 * @param newZ	 *                   new z	 * @param overwrite	 *                   true if you want to overwrite an existing Character that stays	 *                   in the new position	 * @return true if the movement was done	 * @todo use the Character c to know oldX, oldY, oldZ and to change c	 *            coords.	 */	public boolean moveCharacter(isoj2me.Character c, int oldX, int oldY,			int oldZ, int newX, int newY, int newZ, boolean overwrite) {		if (charactersPositions.remove(oldX + "_" + oldY + "_" + oldZ) != null) {			if (overwrite != true) {				if (!charactersPositions.containsKey(newX + "_" + newY + "_"						+ newZ)) {					charactersPositions.put(newX + "_" + newY + "_" + newZ, c);					return true;				} else {					return false;				}			} else {				charactersPositions						.put(newX + "_" + newY + "_" + newZ,								charactersPositions.get(oldX + "_" + oldY + "_"										+ oldZ));				charactersPositions.remove(oldX + "_" + oldY + "_" + oldZ);			}			return true;		} else {			return false;		}	}	/**	 * Move an Item on the Board	 * 	 * @param i	 *                   Item to move	 * @param oldX	 *                   old x	 * @param oldY	 *                   old y	 * @param oldZ	 *                   old z	 * @param newX	 *                   new x	 * @param newY	 *                   new y	 * @param newZ	 *                   new z	 * @param overwrite	 *                   true if you want to overwrite an existing Item that stays in	 *                   the new position	 * @return true if the movement was done	 * 	 * @todo use the Item i to know oldX, oldY, oldZ and to change c coords.	 */	public boolean moveItem(isoj2me.Item i, int oldX, int oldY, int oldZ,			int newX, int newY, int newZ, boolean overwrite) {		if (itemsPositions.remove(oldX + "_" + oldY + "_" + oldZ) != null) {			if (overwrite != true) {				if (!itemsPositions.containsKey(newX + "_" + newY + "_" + newZ)) {					itemsPositions.put(newX + "_" + newY + "_" + newZ, i);					return true;				} else {					return false;				}			} else {				itemsPositions						.put(newX + "_" + newY + "_" + newZ,								charactersPositions.get(oldX + "_" + oldY + "_"										+ oldZ));				itemsPositions.remove(oldX + "_" + oldY + "_" + oldZ);			}			return true;		} else {			return false;		}	}	/**	 * This method change the shape of the basic tile. This affect the	 * coordinates of the tiles painted by the <b>draw() </b> method	 * 	 * @param width	 *                   the width of the tile	 * @param height	 *                   the distance between the base of the tile file and the "floor"	 *                   of the basic tile	 */	public void setTileSize(int width, int height) {		tileWidth = width;		tileHeight = height;	}	/**	 * This method call the Map() constructor passing the base name for the map	 * files and the number of layers	 * 	 * @param baseFilename	 *                   base name for the map files	 * @param numberOfLayers	 *                   number of layers to load	 */	public void createMap(String baseFilename, int numberOfLayers) {		map = new Map(baseFilename, numberOfLayers);	}	/**	 * This one of the main method of this class. It paint on the given Graphics	 * the board with its tiles and characters.	 * 	 * @param x	 *                   where to paint on the Graphics (x)	 * @param y	 *                   where to paint on the Graphics (y)	 * @param cellX	 *                   starting cell on the map (x)	 * @param cellY	 *                   starting cell on the mpa (y)	 * @param width	 *                   width of the map area to be painted (starting from cellX)	 * @param height	 *                   height of the map area to be painted (starting from cellY)	 * @param g	 *                   Graphics object where to paint	 */	public void draw(int x, int y, int cellX, int cellY, int width, int height,			Graphics g) {		if (cellX < 0) {			cellX = 0;		}		if (cellY < 0) {			cellY = 0;		}		if (cellX > map.getWidth()) {			cellX = map.getWidth();		}		if (cellY > map.getHeight()) {			cellY = map.getHeight();		}		int x_temp, y_temp;		x_temp = x;		int x_init = x_temp;		int y_temp2 = 0;		for (int i = 0; i < height; i++) { // y cycle			y_temp = y + tileHeight * i;			x_temp = x_init - (tileWidth / 2) * i;			for (int j = 0; j < width; j++) { // x cycle				y_temp2 = y_temp;				for (int k = 0; k < map.numberOfLayers; k++) { // layers																							// cycle					y_temp = y_temp2 - (tileHeight * k);					if (map.layers[k] != null) {						if (i + cellY < map.getHeight()								&& j + cellX < map.getWidth()) {							g									.drawImage(											Utility													.loadImage(															tileSet																	+ map.layers[k][((i + cellY) * map																			.getWidth())																			+ (j + cellX)],															tiles),											x_temp													- ((Utility															.loadImage(																	tileSet																			+ map.layers[k][((i + cellY) * map																					.getWidth())																					+ (j + cellX)],																	tiles)															.getWidth() - tileWidth) / 2),											y_temp													- (Utility															.loadImage(																	tileSet																			+ map.layers[k][((i + cellY) * map																					.getWidth())																					+ (j + cellX)],																	tiles)															.getHeight() - tileHeight),											Graphics.TOP | Graphics.LEFT);						}					}					//Paint characters					if (charactersPositions.containsKey((j + cellX) + "_"							+ (i + cellY) + "_" + k)) {						isoj2me.Character temp_character = (isoj2me.Character) charactersPositions								.get((j + cellX) + "_" + (i + cellY) + "_" + k);						int temp_char_x = x_temp								+ (tileWidth - temp_character.getCurrentImage()										.getWidth()) / 2;						temp_character								.draw(temp_char_x, y_temp - tileHeight, g);					}					//	Paint items					if (itemsPositions.containsKey((j + cellX) + "_"							+ (i + cellY) + "_" + k)) {						isoj2me.Item temp_character = (isoj2me.Item) itemsPositions								.get((j + cellX) + "_" + (i + cellY) + "_" + k);						int temp_char_x = x_temp								+ (tileWidth - temp_character.getCurrentImage()										.getWidth()) / 2;						temp_character								.draw(temp_char_x, y_temp - tileHeight, g);					}				}				y_temp = y_temp2;				x_temp = x_temp + tileWidth / 2;				y_temp = y_temp + tileHeight;			}		}	}}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久青草欧美一区二区三区| 日韩制服丝袜av| 亚洲精品菠萝久久久久久久| 亚洲成av人片在www色猫咪| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产专区欧美精品| 欧美一区二区三区小说| 中文字幕不卡在线播放| 亚洲国产精品综合小说图片区| 久久精品99国产精品| 成人av先锋影音| 久久精品视频一区二区三区| 午夜视频久久久久久| 91看片淫黄大片一级| 亚洲国产岛国毛片在线| 国产真实乱偷精品视频免| 欧美日韩国产综合草草| 亚洲国产另类av| 欧美怡红院视频| 亚洲精品高清在线| 色播五月激情综合网| 亚洲视频一区二区在线| 99re这里只有精品6| 国产精品免费网站在线观看| 国产成人av一区二区三区在线| 欧美大白屁股肥臀xxxxxx| 午夜精彩视频在线观看不卡| 91成人免费电影| 亚洲一区中文在线| 在线观看成人小视频| 亚洲无线码一区二区三区| 91成人国产精品| 亚洲成人精品一区二区| 欧美视频一二三区| 亚洲国产一区二区三区青草影视| 91社区在线播放| 中文字幕高清不卡| 97久久超碰国产精品| 亚洲精品第一国产综合野| 在线看不卡av| 日韩中文字幕av电影| 日韩欧美一级在线播放| 狠狠狠色丁香婷婷综合激情 | 国产自产v一区二区三区c| 2021中文字幕一区亚洲| 国产成人小视频| 中文字幕一区二区5566日韩| 一本到不卡免费一区二区| 亚洲电影在线免费观看| 精品噜噜噜噜久久久久久久久试看| 老司机免费视频一区二区三区| 国产午夜精品一区二区三区视频| 成人网在线播放| 狠狠色狠狠色综合系列| 最新久久zyz资源站| 欧美日韩亚洲另类| 国产综合色视频| 亚洲色图20p| 精品久久久久久最新网址| 国产精品888| 亚洲国产视频一区二区| 精品av综合导航| 91网站在线播放| 久久精品99国产精品日本| 1024成人网| 欧美xxxxx裸体时装秀| 色悠悠亚洲一区二区| 男女激情视频一区| 中文字幕一区二区三中文字幕| 欧美熟乱第一页| 丰满放荡岳乱妇91ww| 午夜精品福利一区二区蜜股av| 久久久久久**毛片大全| 欧美剧情片在线观看| 99国产精品国产精品久久| 免费看欧美女人艹b| 一区二区三区中文在线| 久久久久亚洲蜜桃| 欧美日韩国产另类一区| 成人精品国产一区二区4080| 日本亚洲视频在线| 一区二区三区在线免费视频| 2023国产一二三区日本精品2022| 91国内精品野花午夜精品| 国产大片一区二区| 日韩成人av影视| 亚洲精品成人悠悠色影视| 久久久蜜桃精品| 日韩欧美国产一二三区| 欧美三电影在线| 成人精品视频一区二区三区| 成人av手机在线观看| 国产麻豆午夜三级精品| 五月婷婷欧美视频| 亚洲欧美国产高清| 国产欧美日韩综合| 久久久久久久av麻豆果冻| 欧美不卡123| 91精品国产综合久久久久久漫画| 在线免费不卡视频| a级高清视频欧美日韩| 粉嫩av一区二区三区粉嫩| 国产一区二区精品在线观看| 青青草原综合久久大伊人精品| 亚洲欧美视频在线观看| 亚洲欧美日韩系列| 亚洲欧洲精品一区二区三区| 国产精品私房写真福利视频| 久久久精品国产免费观看同学| 日韩一区二区中文字幕| 日韩美女一区二区三区四区| 日韩小视频在线观看专区| 欧美一区中文字幕| 欧美mv日韩mv国产网站app| 精品国产区一区| 久久久久久毛片| 国产精品免费丝袜| 国产精品福利电影一区二区三区四区| 国产亚洲一区二区在线观看| 国产欧美日韩视频在线观看| 中文字幕欧美日韩一区| 亚洲人成网站影音先锋播放| 亚洲黄色性网站| 日韩在线播放一区二区| 久久国内精品自在自线400部| 老色鬼精品视频在线观看播放| 久久99久久久久久久久久久| 精品在线播放午夜| 国产传媒一区在线| 91美女福利视频| 51精品国自产在线| 国产女人水真多18毛片18精品视频 | 偷偷要91色婷婷| 日本欧美在线观看| 国产精品一二三区在线| www.性欧美| 欧美日韩高清一区二区三区| 欧美va亚洲va香蕉在线| 国产亚洲美州欧州综合国| 亚洲欧洲制服丝袜| 免费在线观看一区| 成人国产电影网| 欧美曰成人黄网| 精品va天堂亚洲国产| 亚洲男同性视频| 免费成人在线观看视频| 成人sese在线| 91精品综合久久久久久| 国产日韩欧美高清在线| 亚洲一区二区视频在线| 国产精品综合视频| 欧美日韩国产另类一区| 国产亚洲制服色| 午夜电影网一区| 成人aaaa免费全部观看| 538在线一区二区精品国产| 久久久99久久精品欧美| 亚洲成人黄色小说| 成人免费高清在线| 日韩一区二区三区三四区视频在线观看 | 99在线热播精品免费| 欧美一区二区国产| 亚洲欧美日韩一区| 国产高清不卡二三区| 欧美巨大另类极品videosbest | 91色porny| 精品少妇一区二区三区在线播放| 18欧美乱大交hd1984| 国产乱妇无码大片在线观看| 欧美日韩在线电影| 中文字幕五月欧美| 国产一区二区不卡在线 | 蜜桃av一区二区在线观看| 91视频免费播放| 国产欧美1区2区3区| 久久99国产乱子伦精品免费| 精品视频在线免费观看| 亚洲欧洲精品一区二区三区| 国产乱码字幕精品高清av| 欧美一卡在线观看| 日韩国产精品91| 欧美嫩在线观看| 亚洲一区日韩精品中文字幕| 99久久综合狠狠综合久久| 久久精品亚洲精品国产欧美kt∨| 久久er精品视频| 日韩久久久精品| 免费国产亚洲视频| 91麻豆精品国产91久久久资源速度| 亚洲综合色噜噜狠狠| 日本高清不卡在线观看| 亚洲精品午夜久久久| 91久久精品日日躁夜夜躁欧美| **网站欧美大片在线观看| 99视频在线精品| 亚洲欧洲综合另类在线| 91国在线观看| 亚洲午夜在线观看视频在线| 欧美性色黄大片手机版| 性久久久久久久久久久久|