本文整理汇总了Java中org.newdawn.slick.tiled.TiledMap.getMapProperty方法的典型用法代码示例。如果您正苦于以下问题:Java TiledMap.getMapProperty方法的具体用法?Java TiledMap.getMapProperty怎么用?Java TiledMap.getMapProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.tiled.TiledMap
的用法示例。
在下文中一共展示了TiledMap.getMapProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.newdawn.slick.tiled.TiledMap; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
*/
public void init(GameContainer container) throws SlickException {
map = new TiledMap("testdata/testmap.tmx","testdata");
// read some properties from map and layer
mapName = map.getMapProperty("name", "Unknown map name");
monsterDifficulty = map.getLayerProperty(0, "monsters", "easy peasy");
nonExistingMapProperty = map.getMapProperty("zaphod", "Undefined map property");
nonExistingLayerProperty = map.getLayerProperty(1, "beeblebrox", "Undefined layer property");
// store the original tileid of layer 0 at 10, 10
originalTileID = map.getTileId(10, 10, 0);
}
示例2: Level
import org.newdawn.slick.tiled.TiledMap; //导入方法依赖的package包/类
public Level(String level, Player player) throws SlickException {
map = new TiledMap("ressources/level/" + level + ".tmx");
background = new Image("ressources/background/" + map.getMapProperty("back.png", "back.png"));
characters = new ArrayList<Character>();
levelObjects = new ArrayList<LevelObject>();
this.player = player;
addCharacter(player);
loadTileMap();
loadLimite();
loadEnd();
}