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

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

?? board.java

?? 斜45度游戲范例
?? JAVA
字號:
package isoj2me;import javax.microedition.lcdui.*;import java.util.Hashtable;import java.util.Vector;import java.util.Enumeration;/** * <p>Title: isoj2me: J2ME Isometric Engine</p> * <p>Description: An engine/framework for isometric games (like japanese RPGs) for mobile devices supporting J2ME (MIDP 1.0). This engine will manage maps, objects and characters. Visit http://sourceforge.net/projects/isoj2me</p> * <p>Copyright: Copyright (c) 2004</p> * <p>License: Lesser GPL (http://www.gnu.org)</p> * <p>Company: Mondonerd.com</p> * @author Massimo Maria Avvisati * @version 0.2 */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);  private Vector characters = new Vector();  private Vector items = new Vector();  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;  }  /**   * After adding a Character to the Board you'll be able to get it as an object using this method.   * @param name name of the Character you want to get   * @return Character with that name   */  public isoj2me.Character getCharacter(String name) {    Enumeration list = characters.elements();    while (list.hasMoreElements()) {      isoj2me.Character temp_c = (isoj2me.Character) list.nextElement();      if (temp_c.name.equals(name)) {	return temp_c;      }    }    return null;  }  public isoj2me.Item getItem(String name) {    Enumeration list = items.elements();    while (list.hasMoreElements()) {      isoj2me.Item temp_i = (isoj2me.Item) list.nextElement();      if (temp_i.name.equals(name)) {	return temp_i;      }    }    return null;  }  /**   * 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.addElement(c);  }  public void putItem(isoj2me.Item i) {    itemsPositions.put(i.x + "_" + i.y + "_" + i.z, i);    items.addElement(i);  }  /**   * 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.addElement(c);  }  /**   * 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;  }  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   */  public boolean moveCharacter(isoj2me.Character c, int oldX, int oldY,			       int oldZ, int newX, int newY,			       int newZ, boolean overwrite) {    if (charactersPositions.containsKey(oldX + "_" + oldY + "_" + oldZ)) {      if (overwrite != true) {	if (!charactersPositions.containsKey(newX + "_" + newY + "_" + newZ)) {	  charactersPositions.put(newX + "_" + newY + "_" + newZ, c);	  charactersPositions.remove(oldX + "_" + oldY +				     "_" + oldZ);	  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;    }  }  public boolean moveItem(isoj2me.Item i, int oldX, int oldY,			  int oldZ, int newX, int newY,			  int newZ, boolean overwrite) {    if (itemsPositions.containsKey(oldX + "_" + oldY + "_" + oldZ)) {      if (overwrite != true) {	if (!itemsPositions.containsKey(newX + "_" + newY + "_" + newZ)) {	  itemsPositions.put(newX + "_" + newY + "_" + newZ, i);	  itemsPositions.remove(oldX + "_" + oldY +				"_" + oldZ);	  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;    y_temp = y;    int x_init = x_temp;    boolean iso = true;    int y_temp2 = 0;    for (int i = 0; i < height; i++) {      y_temp = y + tileHeight * i;      x_temp = x_init - (tileWidth / 2) * i;      for (int j = 0; j < width; j++) {	y_temp2 = y_temp;	for (int k = 0; k < map.numberOfLayers; k++) {	  y_temp = y_temp2 - (tileHeight * k);	  if (map.layers[k] != null) {	    if (i + cellY < map.getHeight() && j + cellX < map.getWidth()) {	      g.drawImage(Utility.loadTile(tileSet +					   map.layers[k][ ( (i + cellY) *		  map.getWidth()) +					   (j + cellX)], tiles),			  x_temp,			  y_temp -			  (Utility.loadTile(tileSet +					    map.layers[k][ ( (i + cellY) *		  map.getWidth()) +					    (j + cellX)], tiles).			   getHeight() - tileHeight),			  g.TOP | g.LEFT);	    }	  }	  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);	  }	  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;      }    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产日韩一二三区| 日本一区二区三区高清不卡| 国产精品一级片| 亚洲高清免费一级二级三级| 久久久亚洲欧洲日产国码αv| 在线日韩av片| 懂色av噜噜一区二区三区av| 午夜久久福利影院| 亚洲精品视频免费看| 国产亚洲va综合人人澡精品| 51精品视频一区二区三区| www.久久久久久久久| 国产在线播放一区三区四| 成人黄色在线看| 日韩精品欧美精品| 尤物在线观看一区| 国产精品入口麻豆九色| 日韩午夜电影在线观看| 欧美中文字幕一二三区视频| 成人h动漫精品一区二区| 久久狠狠亚洲综合| 丝袜国产日韩另类美女| 亚洲激情av在线| 国产精品国产自产拍高清av王其 | 91老师国产黑色丝袜在线| 精品制服美女久久| 蜜桃av一区二区在线观看| 亚洲国产欧美在线| 一区二区三区在线不卡| 国产精品高潮呻吟| 国产精品日日摸夜夜摸av| 国产亚洲欧美日韩日本| 久久影视一区二区| 欧美v日韩v国产v| 精品理论电影在线| 日韩视频一区在线观看| 欧美精品粉嫩高潮一区二区| 欧美日韩国产欧美日美国产精品| 欧美在线色视频| 欧美三日本三级三级在线播放| 91免费版pro下载短视频| 99久久99久久久精品齐齐| www.亚洲在线| 91视频一区二区| 一本大道久久a久久精品综合| 成人白浆超碰人人人人| 99re成人在线| 91福利在线免费观看| 欧美丝袜丝交足nylons图片| 在线看日韩精品电影| 欧美影视一区在线| 在线播放中文字幕一区| 日韩一本二本av| 久久影视一区二区| 中文字幕中文字幕在线一区| 中文字幕日韩av资源站| 亚洲精品中文在线影院| 亚洲国产一区二区视频| 日本亚洲电影天堂| 久久99精品久久久久久国产越南| 国模套图日韩精品一区二区| 99这里只有久久精品视频| 一道本成人在线| 欧美一区二区网站| 亚洲精品一区二区三区99| 中文字幕高清不卡| 亚洲一级不卡视频| 美女网站一区二区| 成人高清免费观看| 欧美日本一道本在线视频| 精品久久国产老人久久综合| 欧美激情一区二区在线| 亚洲三级视频在线观看| 日韩国产高清影视| 国产激情视频一区二区三区欧美 | 91在线一区二区| 欧美一级免费大片| 日本一区二区三区四区| 亚洲欧美日韩电影| 免费一级欧美片在线观看| 成人av在线资源网站| 欧美色图片你懂的| 国产欧美一区二区三区在线看蜜臀| 亚洲激情自拍视频| 狠狠久久亚洲欧美| 色狠狠av一区二区三区| 精品国产免费久久| 亚洲国产精品嫩草影院| 国产福利一区在线| 91麻豆精品国产91久久久久久 | 精品国产自在久精品国产| 国产精品国产三级国产| 蜜桃精品视频在线| 色香色香欲天天天影视综合网| 日韩欧美久久久| 亚洲第一在线综合网站| 成人国产亚洲欧美成人综合网| 宅男在线国产精品| 综合久久给合久久狠狠狠97色| 免费黄网站欧美| 欧美色男人天堂| 国产精品嫩草影院av蜜臀| 精品一区二区三区在线观看国产| 色噜噜狠狠成人中文综合| 久久久久久久久免费| 亚洲成av人片在线观看无码| www.欧美日韩| 国产亚洲精品中文字幕| 日韩不卡一区二区三区| 91激情在线视频| 国产精品私人影院| 国产成人综合亚洲网站| 欧美成人a在线| 秋霞电影网一区二区| 欧美日韩免费高清一区色橹橹| 国产精品麻豆视频| 高清成人在线观看| 久久久99精品免费观看| 极品销魂美女一区二区三区| 91精品国产综合久久久蜜臀图片| 亚洲在线成人精品| 在线看国产一区| 亚洲日本电影在线| 99国产精品久久久久| 国产精品女同互慰在线看| 风间由美性色一区二区三区| 久久久久久97三级| 国产精品一色哟哟哟| www久久久久| 国产成人亚洲精品狼色在线 | 欧美videos大乳护士334| 日韩中文字幕91| 欧美精选午夜久久久乱码6080| 亚洲福利国产精品| 欧美日韩一区二区三区高清| 亚洲福利视频一区| 91精品国产乱| 久久9热精品视频| 精品国产不卡一区二区三区| 麻豆免费看一区二区三区| 欧美成人一区二区三区在线观看| 久久电影国产免费久久电影| 日韩精品一区二区三区中文精品| 蜜乳av一区二区三区| 亚洲精品一区二区精华| 国产成a人亚洲精| 亚洲欧洲日产国码二区| 91麻豆视频网站| 亚洲超碰97人人做人人爱| 欧美一区欧美二区| 国产在线精品一区二区不卡了| 国产欧美一区二区精品秋霞影院| 成人三级伦理片| 亚洲精品久久7777| 欧美精选在线播放| 国产麻豆精品一区二区| 国产精品的网站| 欧美私模裸体表演在线观看| 美女视频黄 久久| 国产人久久人人人人爽| 色婷婷久久久久swag精品| 日韩精品成人一区二区在线| 精品国产污污免费网站入口| 懂色av一区二区在线播放| 一区二区在线观看视频在线观看| 欧美精品一二三| 国产精品亚洲一区二区三区妖精| 亚洲欧美综合另类在线卡通| 欧美人体做爰大胆视频| 国产九色sp调教91| 一级日本不卡的影视| 欧美高清激情brazzers| 国产91精品免费| 亚洲va韩国va欧美va精品| 亚洲精品一区在线观看| 91麻豆国产在线观看| 免费高清在线视频一区·| 中文字幕在线免费不卡| 欧美精品v日韩精品v韩国精品v| 国产精品一区二区在线观看不卡| 亚洲色图19p| 精品黑人一区二区三区久久| 99精品视频免费在线观看| 蜜桃视频第一区免费观看| 国产精品国产三级国产普通话蜜臀 | 久久亚洲精品国产精品紫薇| 91麻豆自制传媒国产之光| 国内精品国产成人国产三级粉色 | 婷婷激情综合网| 中文字幕国产一区| 91精品国产福利| 在线观看成人免费视频| 国产伦精一区二区三区| 丝袜美腿亚洲综合| 亚洲色图都市小说| 国产亚洲精品久| 欧美一区二区精品久久911| 91国产视频在线观看| 成人国产精品免费观看视频| 蜜臀av亚洲一区中文字幕|