本文整理汇总了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();
}
示例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;
}
示例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");
}
示例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();
}
}
}
示例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();
}
示例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;
}
}
}
示例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();
}
}
示例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();
}
}
示例9: process
import com.artemis.Entity; //导入方法依赖的package包/类
@Override
protected void process(Entity e) {
if ( sm.get(e).selected )
{
e.deleteFromWorld();
}
}
示例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();
}
}
示例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;
}
}
示例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();
}