public void act() { mCount++; if (getLifeCycle() == State.Dive) setY((short) (incrementY() + y())); else if (getLifeCycle() == State.Dead) { checkRemove(); } super.act(); }
public void tick() { for (Class<? extends Actor> cls : actOrder) for (Actor actor : getActors(cls)) { if (!actor.expired() && !actor.getClass().equals(Player.class)) { actor.act(); } } removeExpired(); }
public void step() { Grid<Actor> gr = getGrid(); ArrayList<Actor> actors = new ArrayList<Actor>(); for (Location loc : gr.getOccupiedLocations()) actors.add(gr.get(loc)); for (Actor a : actors) { // only act if another actor hasn't removed a if (a.getGrid() == gr) a.act(); } }
public void act() { super.act(); y += vy; x += vx; if (y < 0 || y > Stage.HEIGHT || x < 0 || x > Stage.WIDTH) remove(); }
public void performPlay() { actor.act(); }
@Test public void testAct() { Actor actorObject = new Actor(); Assert.assertEquals(actorObject.act("Chiranjeevi"), "Chiranjeevi is acting..."); Assert.assertEquals(actorObject.act("Nagarjuna"), "Nagarjuna is acting..."); }
public void act() { super.act(); y -= BULLET_SPEED; if (y < 0) remove(); }
/** Take a single step of the simulation. */ public void step() { for (Actor actor : actors) { actor.act(); } }