当前位置: 首页>>代码示例>>Java>>正文


Java StaticTiledMapTile类代码示例

本文整理汇总了Java中com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile的典型用法代码示例。如果您正苦于以下问题:Java StaticTiledMapTile类的具体用法?Java StaticTiledMapTile怎么用?Java StaticTiledMapTile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StaticTiledMapTile类属于com.badlogic.gdx.maps.tiled.tiles包,在下文中一共展示了StaticTiledMapTile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Item

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public Item(MapCellCoordinates cellPos, TextureRegion itemTexture, MapLoader map, EntityManager entityManager) 
{
    super(new ThinGridCoordinates(cellPos.getX(), cellPos.getY()), new ThinGridCoordinates(0,0), map, entityManager);
    
    this.emptyBlock = TextureManager.emptyBlock;
    this.cellPos = cellPos;
    this.sendCommand = entityManager.getSendCommand();
    
    
    
    if(!map.isCellBlocked(cellPos)){
    //Render Item once
    TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
    cell.setTile(new StaticTiledMapTile(itemTexture));
    map.getItemLayer().setCell(cellPos.getX(), cellPos.getY(), cell);
    }else{
        collected = true;
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:20,代码来源:Item.java

示例2: render

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
@Override
public void render()
{
    if(!map.isCellBlocked(cellPos))
    {
        //Create new cell and set its animation texture
        TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
        cell.setTile(new StaticTiledMapTile(animEffects.getFrame(blockAnim, true)));
        cell.getTile().getProperties().put("poisonGas", null);

        //Set texture into block layer
        blockLayer.setCell(super.cellPos.getX(), super.cellPos.getY(), cell);
    }else
    {
        super.destroyed = true;
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:18,代码来源:PoisonGas.java

示例3: deleteUp

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void deleteUp(){
    for(int y=1; y <= explosionRange; y++){
        TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
        cell.setTile(new StaticTiledMapTile(emptyBlock));

        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX(), cellPos.getY() + y)))
        {
            //Delete explosion effect
            map.getBombLayer().setCell(cellPos.getX(), cellPos.getY() + y, cell);
            
            //Delete block
            deleteBlock(new MapCellCoordinates(cellPos.getX(), cellPos.getY() + y));
            
            break;
        }
        
        //Explosion down
        map.getBombLayer().setCell(cellPos.getX(), cellPos.getY() + y, cell);
        deleteBlock(new MapCellCoordinates(cellPos.getX(), cellPos.getY() + y));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:23,代码来源:Turret.java

示例4: deleteRight

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void deleteRight(){
    for(int x=1; x <= explosionRange; x++){
        TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
        cell.setTile(new StaticTiledMapTile(emptyBlock));

        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX() + x, cellPos.getY())))
        {
            //Delete explosion effect
            map.getBombLayer().setCell(cellPos.getX() + x, cellPos.getY(), cell);
            
            //Delete block
            deleteBlock(new MapCellCoordinates(cellPos.getX() + x, cellPos.getY()));
            
            break;
        }
        
        //Explosion down
        map.getBombLayer().setCell(cellPos.getX() + x, cellPos.getY(), cell);
        deleteBlock(new MapCellCoordinates(cellPos.getX() + x, cellPos.getY()));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:23,代码来源:Turret.java

示例5: deleteDown

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void deleteDown(){
    for(int y=1; y <= explosionRange; y++){
        TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
        cell.setTile(new StaticTiledMapTile(emptyBlock));

        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX(), cellPos.getY() - y)))
        {
            //Delete explosion effect
            map.getBombLayer().setCell(cellPos.getX(), cellPos.getY() - y, cell);
            
            //Delete block
            deleteBlock(new MapCellCoordinates(cellPos.getX(), cellPos.getY() - y));
            
            break;
        }
        
        //Explosion down
        map.getBombLayer().setCell(cellPos.getX(), cellPos.getY() - y, cell);
        deleteBlock(new MapCellCoordinates(cellPos.getX(), cellPos.getY() - y));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:23,代码来源:Turret.java

示例6: deleteLeft

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void deleteLeft(){
    for(int x=1; x <= explosionRange; x++){
        TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
        cell.setTile(new StaticTiledMapTile(emptyBlock));

        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX() - x, cellPos.getY())))
        {
            //Delete explosion effect
            map.getBombLayer().setCell(cellPos.getX() - x, cellPos.getY(), cell);
            
            //Delete block
            deleteBlock(new MapCellCoordinates(cellPos.getX() - x, cellPos.getY()));
            
            break;
        }
        
        //Explosion down
        map.getBombLayer().setCell(cellPos.getX() - x, cellPos.getY(), cell);
        deleteBlock(new MapCellCoordinates(cellPos.getX() - x, cellPos.getY()));
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:23,代码来源:Turret.java

示例7: createL0Animation

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void createL0Animation(Texture tileTexture, String tag){

		//hardcoded grass texture region
		Tile = new Array<StaticTiledMapTile>();

		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,0,0,32,32)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,32,0,32,32)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,64,0,32,32)));

		TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().get(0);
		for(int x = 0; x < layer.getWidth();x++){
			for(int y = 0; y < layer.getHeight();y++){
				TiledMapTileLayer.Cell cell = layer.getCell(x,y);
				Object property = cell.getTile().getProperties().get(tag);
				if(property != null){
					cell.setTile(new AnimatedTiledMapTile(1.5f,Tile));
				}
			}
		}
	}
 
开发者ID:n-chunky,项目名称:TTmath,代码行数:21,代码来源:LevelAnimationManager.java

示例8: createL1SmallAnimation

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void createL1SmallAnimation(Texture tileTexture, String tag){

		//hardcoded grass texture region
		Tile = new Array<StaticTiledMapTile>();

		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,0,0,32,32)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,32,0,32,32)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,64,0,32,32)));

		TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().get(1);
		for(int x = 0; x < layer.getWidth();x++){
			for(int y = 0; y < layer.getHeight();y++){
				TiledMapTileLayer.Cell cell = layer.getCell(x,y);
				if(cell!=null && cell.getTile().getProperties().get(tag)!=null){
					cell.setTile(new AnimatedTiledMapTile(1.5f,Tile));
				}
			}
		}
	}
 
开发者ID:n-chunky,项目名称:TTmath,代码行数:20,代码来源:LevelAnimationManager.java

示例9: createL1LargeAnimation

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void createL1LargeAnimation(Texture tileTexture, String tag){

		//hardcoded grass texture region
		Tile = new Array<StaticTiledMapTile>();

		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,0,0,64,64)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,64,0,64,64)));
		Tile.add(new StaticTiledMapTile(new TextureRegion(tileTexture,128,0,64,64)));

		TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().get(1);
		for(int x = 0; x < layer.getWidth();x++){
			for(int y = 0; y < layer.getHeight();y++){
				TiledMapTileLayer.Cell cell = layer.getCell(x,y);
				if(cell!=null && cell.getTile().getProperties().get(tag)!=null){
					cell.setTile(new AnimatedTiledMapTile(1.5f,Tile));
				}
			}
		}
	}
 
开发者ID:n-chunky,项目名称:TTmath,代码行数:20,代码来源:LevelAnimationManager.java

示例10: deleteItem

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
/**
 * Deletes item texture in cell.
 */
public void deleteItem()
{
    TiledMapTileLayer.Cell cellCenter = new TiledMapTileLayer.Cell();
    cellCenter.setTile(new StaticTiledMapTile(emptyBlock));
    map.getItemLayer().setCell(cellPos.getX(), cellPos.getY(), cellCenter);
    collected = true;
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:11,代码来源:Item.java

示例11: render

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
@Override
public void render()
{
    //Render item
    TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
    cell.setTile(new StaticTiledMapTile(animEffects.getFrame(TextureManager.coinAnim, true)));
    map.getItemLayer().setCell(cellPos.getX(), cellPos.getY(), cell);
    
    super.deleteItemThroughBomb();
    
    if(isMainPlayerCollectingItem() == true)
    {
        itemEffect();
    }
    
    if(getPlayerIdCollectingItem() != -1)
    {
        sound = AudioManager.getSingleCoin();
        soundId = sound.play();
    }
    
    Player player = entityManager.getPlayerManager().getCurrentPlayerObject();
    if(player != null && sound != null)
    {
        player.playSoundInDistance(sound, soundId, pos, Constants.COINMOD);
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:28,代码来源:Coin.java

示例12: deleteBlock

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
/**
 * Deltes block on given cell position. Spawns also a coin randomly on destroyed blocks.
 * If it is undestructable nothing happens and false gets returned.
 * @param x: Cell position on x axis
 * @param y: Cell position on y axis
 * @return boolean
 */ 
protected boolean deleteBlock(MapCellCoordinates localCellPos)
{
    Cell currentCell = blockLayer.getCell(localCellPos.getX() , localCellPos.getY());
    
    if(currentCell != null)
    {
        //If block is undestructable
        if(currentCell.getTile().getProperties().containsKey("undestructable"))
        {
            return false;
            
        }else
        {
            //Delete block with empty texture
            Cell cell = new Cell();
            cell.setTile(new StaticTiledMapTile(emptyBlock));
            map.getBlockLayer().setCell(localCellPos.getX(), localCellPos.getY(), cell);
            
            
            /**---------------------RANDOM COIN---------------------**/
            //Check for a bug and if main player placed that bomb
            if(currentCell.getTile().getId() != cell.getTile().getId() && playerId == Constants.PLAYERID)
            {
                dropFromBlock(localCellPos);
            }
        }
    }

    // If there is no block 
    return true;
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:39,代码来源:Bomb.java

示例13: explodeUp

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void explodeUp(){
    //Explode UP
    for(int y=1; y <= explosionRange; y++)
    {
        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX(), cellPos.getY() + y )))
        {
            //Set ending texture and break out of loop
            TiledMapTileLayer.Cell cellDown = new TiledMapTileLayer.Cell();
            cellDown.setTile(new StaticTiledMapTile(explosionUpEnd));
            cellDown.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() + y, cellDown);
            break;
        }
        
        if(y != explosionRange) // If not end of explosion
        {
            TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
            cell.setTile(new StaticTiledMapTile(explosionYMiddle));
            cell.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() + y, cell);
        }else
        {
            //Set end of explosion
            TiledMapTileLayer.Cell cellUp = new TiledMapTileLayer.Cell();
            cellUp.setTile(new StaticTiledMapTile(explosionUpEnd));
            cellUp.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() + y, cellUp);
        }
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:35,代码来源:Turret.java

示例14: explodeRight

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void explodeRight(){
    //Explode RIGHT
    for(int x=1; x <= explosionRange; x++)
    {
        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX() +x, cellPos.getY())))
        {
            //Set ending texture and break out of loop
            TiledMapTileLayer.Cell cellDown = new TiledMapTileLayer.Cell();
            cellDown.setTile(new StaticTiledMapTile(explosionRightEnd));
            cellDown.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX() +x, super.cellPos.getY(), cellDown);
            break;
        }
        
        if(x != explosionRange)  // If not end of explosion
        {
            //Set cell with middle explosion texture
            TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
            cell.setTile(new StaticTiledMapTile(explosionXMiddle));
            cell.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX() +x, super.cellPos.getY(), cell);
            
        }else
        {
            //Set end of explosion
            TiledMapTileLayer.Cell cellRight = new TiledMapTileLayer.Cell();
            cellRight.setTile(new StaticTiledMapTile(explosionRightEnd));
            cellRight.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX() +x, super.cellPos.getY(), cellRight);
        }
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:37,代码来源:Turret.java

示例15: explodeDown

import com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile; //导入依赖的package包/类
public void explodeDown(){
    for(int y=1; y <= explosionRange; y++)
    {
        //If explosion hits block
        if(map.isCellBlocked(new MapCellCoordinates(cellPos.getX(), cellPos.getY() - y )))
        {
            //Set ending texture and break out of loop
            TiledMapTileLayer.Cell cellDown = new TiledMapTileLayer.Cell();
            cellDown.setTile(new StaticTiledMapTile(explosionDownEnd));
            cellDown.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() - y, cellDown);
            break;
        }
        
        if(y != explosionRange) // If not end of explosion
        {
            TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();
            cell.setTile(new StaticTiledMapTile(explosionYMiddle));
            cell.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() - y, cell);
        }else
        {
            //Set end of explosion
            TiledMapTileLayer.Cell cellUp = new TiledMapTileLayer.Cell();
            cellUp.setTile(new StaticTiledMapTile(explosionDownEnd));
            cellUp.getTile().getProperties().put("deadly", null);
            
            map.getBombLayer().setCell(super.cellPos.getX(), super.cellPos.getY() - y, cellUp);
        }
    }
}
 
开发者ID:Aeo-Informatik,项目名称:Space-Bombs,代码行数:34,代码来源:Turret.java


注:本文中的com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。