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


Java Entity.deleteFromWorld方法代码示例

本文整理汇总了Java中com.artemis.Entity.deleteFromWorld方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.deleteFromWorld方法的具体用法?Java Entity.deleteFromWorld怎么用?Java Entity.deleteFromWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.artemis.Entity的用法示例。


在下文中一共展示了Entity.deleteFromWorld方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unconceal

import com.artemis.Entity; //导入方法依赖的package包/类
public void unconceal(Entity e, boolean forceSelect) {
    final Conceal conceal = cm.get(e);

    final Position position = pm.get(e);

    // cover the switch with a cloud.
    particleSystem.cloud((int)(position.x + ToxResource.TILE_SIZE* Animation.DEFAULT_SCALE*0.5f), (int)(position.y+ ToxResource.TILE_SIZE* Animation.DEFAULT_SCALE*0.5f), 20);

    // set entity selected, so it gets instantly selected (and triggered) after being revealed.
    lifetimeSystem.addToWorldLater(conceal.entity, 0.10f);
    if ( forceSelect )
    {
        selectableSystem.forceSelect(conceal.entity, 0.8f);
    }
    conceal.entity = null;

    // no more questionmark required
    e.deleteFromWorld();
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:20,代码来源:ConcealSystem.java

示例2: replace

import com.artemis.Entity; //导入方法依赖的package包/类
public Entity replace( Entity ingredient, Ingredient.Type type) {

		final Pos sourcePos = mPos.get(ingredient);
		ingredient.deleteFromWorld();

		ingredient = setupSystem.createIngredient(0,0, type);
		final Pos newIngredient = mPos.get(ingredient);
		newIngredient.x = sourcePos.x;
		newIngredient.y = sourcePos.y;


		if ( type == Ingredient.Type.BLOOD) {
			mSpawnProtected.create(ingredient);
			mAngle.create(ingredient).rotation = MathUtils.random(0,360f);
			mWet.create(ingredient).liquid = ShowerLiquid.BLOOD;
			abstractAssetSystem.playSfx("chick-squeek");
		} else {
			abstractAssetSystem.playSfx("flatten-eye");
		}
		return ingredient;
	}
 
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:22,代码来源:CrusherSystem.java

示例3: act

import com.artemis.Entity; //导入方法依赖的package包/类
private void act(Entity showery, Entity ingredient) {
	final ShowerLiquid liquid = mShower.get(showery).liquid;
	switch (liquid) {
		case PAINT:
			if (mIngredient.get(ingredient).type == Ingredient.Type.CHICKBUNNY) {
				// replace minion with correct type.
				final Pos sourcePos = mPos.get(ingredient);
				ingredient.deleteFromWorld();
				ingredient = setupSystem.createIngredient(sourcePos.x + 3, sourcePos.y + 3, Ingredient.Type.MINION_PAINTED);
				break;
			}
	}

	// wash away blood.
	if ( mIngredient.get(ingredient).type == Ingredient.Type.BLOOD )
	{
		ingredient.deleteFromWorld();
		return;
	}

	mDrenched.create(ingredient);
	mWet.create(ingredient).liquid = liquid;
	mSpawnProtected.create(ingredient);
	gameScreenAssetSystem.playSfx("shower");
}
 
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:26,代码来源:ShowerSystem.java

示例4: process

import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {

	if ( isWithinGrid() )
	{
		moveToDragLocation(e);
		tintIndicator(e);

		if ( !leftButtonDown ) {
			if ( canDropHere(e) ) {
				abstractAssetSystem.playSfx("drop");
				actuallyMoveSubject(e);
			}
			e.deleteFromWorld();
		}
	}
}
 
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:18,代码来源:TileDropSystem.java

示例5: claimTile

import com.artemis.Entity; //导入方法依赖的package包/类
public void claimTile(Entity tile, boolean deleteClaimedTile ) {
    final Entity player = ToxUtil.getPlayer();

    final Position tileP = pm.get(tile);

    walkTo(player, tileP);

    // replace location with 'cleared' so player can still click to move there.
    if ( deleteClaimedTile ) {
        tile.deleteFromWorld();
    }
    EntityFactory.createClearedLocation((int) tileP.x, (int) tileP.y).addToWorld();

    tickDrug();
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:16,代码来源:PlayerSystem.java

示例6: emptySlot

import com.artemis.Entity; //导入方法依赖的package包/类
private void emptySlot(Inventory.Slot slot) {
    Inventory inventory = getPlayerInventory();
    if (inventory != null) {
        Entity item = inventory.carried[slot.ordinal()];
        if (item != null) {
            item.deleteFromWorld();
            inventory.carried[slot.ordinal()] = null;
        }
    }
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:11,代码来源:InventorySystem.java

示例7: process

import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {
    Position position = pm.get(e);
    Position playerPos = pm.get(ToxUtil.getPlayer());
    Physics physics = phm.get(e);

    // create vector that points from bullet to player;
    int playerX = (int) (playerPos.x + Animation.DEFAULT_SCALE * ToxResource.TILE_SIZE * 0.5f);
    int playerY = (int) (playerPos.y + Animation.DEFAULT_SCALE * ToxResource.TILE_SIZE * 0.5f);
    tmp.set(playerX, playerY)
            .sub(position.x + Animation.DEFAULT_SCALE * 5, position.y + Animation.DEFAULT_SCALE * 5);

    if (tmp.len() > 20) {
        tmp.nor().scl(1200);
        am.get(e).rotation = tmp.angle();
        physics.velocityX = tmp.x;
        physics.velocityY = tmp.y;
    } else {
        particleSystem.explosion(playerX, playerY, Animation.DEFAULT_SCALE * ToxResource.TILE_SIZE);
        if (combatSystem.isAlive(ToxUtil.getPlayer())) {
            combatSystem.damage(ToxUtil.getPlayer(), Math.max(0.1f, hm.get(ToxUtil.getPlayer()).maxHealth / 10));
            if (!combatSystem.isAlive(ToxUtil.getPlayer())) {
                playerSystem.killPlayer("The Jailer");
            }
        }
        e.deleteFromWorld();
    }
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:29,代码来源:BulletSystem.java

示例8: process

import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {
    Terminal terminal = tm.get(e);
    terminal.survivalDuration -= world.delta;
    if (terminal.survivalDuration <= 0) {
        e.deleteFromWorld();
    }
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:9,代码来源:LifetimeSystem.java

示例9: process

import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {
    if ( sm.get(e).selected )
    {
        e.deleteFromWorld();
    }
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:8,代码来源:DissolveSystem.java

示例10: process

import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {
	if ( mClickable.get(e).state == Clickable.ClickState.CLICKED_RIGHT ) {
		em.dispatch(new DeleteEvent(e));
		e.deleteFromWorld();
	}
}
 
开发者ID:DaanVanYperen,项目名称:ns2-scc-profiler,代码行数:8,代码来源:DeletableSystem.java

示例11: act

import com.artemis.Entity; //导入方法依赖的package包/类
private void act(Entity gouger, Entity ingredient) {
	ingredient.deleteFromWorld();

	switch (mIngredient.get(ingredient).type) {
		case CHICK:
			playSfx();
			final Pos pos = mPos.get(gouger);
			setupSystem.createIngredientEject(pos.x + 2 + G.TILE_SIZE / 2, pos.y + 2 + G.TILE_SIZE / 2, Ingredient.Type.BEAD_EYE, 0f);
			setupSystem.createIngredientEject(pos.x + 2 + G.TILE_SIZE / 2, pos.y + 2 + G.TILE_SIZE / 2, Ingredient.Type.BLIND_CHICK, -90f);
			break;
	}
}
 
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:13,代码来源:GougerSystem.java

示例12: pickup

import com.artemis.Entity; //导入方法依赖的package包/类
private void pickup(Entity factory, Entity ingredientEntity) {
	final Ingredient ingredient = mIngredient.get(ingredientEntity);

	// add items to inventory.
	mInventory.get(factory).items[ingredient.type.ordinal()] += ingredient.count;

	// poof!
	ingredientEntity.deleteFromWorld();
}
 
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:InventoryScoopSystem.java


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