Package com.artemis

Examples of com.artemis.Entity.addToWorld()


    assertCapacity(128 * 8, component);
  }

  private static Entity createEntity(World w) {
    Entity e = w.createEntity();
    e.addToWorld();
    return e;
  }
 
  private static void assertCapacity(int minCapacity, SimpleComponent c) throws Exception {
    Field dataField = c.getClass().getDeclaredField("$data");
View Full Code Here


  public void pooled_component_scanning() throws Exception {
    Entity e1 = world.createEntity();
    ComponentToWeave c1a = e1.createComponent(ComponentToWeave.class);
    PooledComponentWithReset c1b = e1.createComponent(PooledComponentWithReset.class);
    PooledComponentNotScanned c1c = e1.createComponent(PooledComponentNotScanned.class);
    e1.addToWorld();
   
    ClassMetadata scan1 = scan(ComponentToWeave.class);
    ClassMetadata scan2 = scan(PooledComponentWithReset.class);
    ClassMetadata scan3 = scan(PooledComponentNotScanned.class);
   
View Full Code Here

  public static Entity createExplosion(World world, float x, float y) {
    Entity e = world.createEntity();
    e.addComponent(new Transform(x, y));
    e.addComponent(new SpatialForm("explosion"));
    e.addComponent(new Expiration(200));
    e.addToWorld();
    return e;
  }

  public static Entity createBullet(World world, float x, float y, float angle, Entity shooter) {
    Entity e = world.createEntity();
View Full Code Here

    // b.setDamping(0.002f);
    // b.setRestitution(0);

    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }

  public static Entity createWall(World world, float x, float y) {
View Full Code Here

    b.setRestitution(0);
    b.setRotDamping(10f);
    b.setFriction(100);
    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }

  public static Entity createCrate(World world, float x, float y, float angleDeg) {
View Full Code Here

    b.setRotDamping(10f);
    b.setFriction(100);
    b.setRotation(angleDeg);
    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }

  public static Entity createMammothTank(World world, float x, float y) {
View Full Code Here

  }

  public static Entity createSound(World world, String soundFileName) {
    Entity sound = world.createEntity();
    sound.addComponent(new SoundFile(soundFileName));
    sound.addToWorld();
    return sound;
  }
}
View Full Code Here

    world.initialize();

    Entity playerTank = EntityFactory.createMammothTank(world, 300f, 400f);
    world.getManager(PlayerManager.class).setPlayer(playerTank, "APPEL");
    world.getManager(TagManager.class).register("PLAYER", playerTank);
    playerTank.addToWorld();

    {
      Entity e = EntityFactory.createMammothTank(world, 600f, 800f);
      world.getManager(PlayerManager.class).setPlayer(e, "COMPUTER 1");
      e.addToWorld();
View Full Code Here

    playerTank.addToWorld();

    {
      Entity e = EntityFactory.createMammothTank(world, 600f, 800f);
      world.getManager(PlayerManager.class).setPlayer(e, "COMPUTER 1");
      e.addToWorld();
    }
    {
      Entity e = EntityFactory.createMammothTank(world, 1000, 200);
      world.getManager(PlayerManager.class).setPlayer(e, "COMPUTER 2");
      e.addToWorld();
View Full Code Here

      e.addToWorld();
    }
    {
      Entity e = EntityFactory.createMammothTank(world, 1000, 200);
      world.getManager(PlayerManager.class).setPlayer(e, "COMPUTER 2");
      e.addToWorld();
    }

    EntityFactory.createWall(world, 756, 540);
    EntityFactory.createWall(world, 756 + (5 * 108), 540);
    EntityFactory.createWall(world, 756 + (10 * 108), 540);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.