Package com.artemis

Examples of com.artemis.Entity.addComponent()


    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "crates");
    e.addComponent(new Health(100, 160));

    SpatialForm form = new SpatialForm("crate");
    e.addComponent(form);

    Body b = new Body(new Box(50, 50), 0.3f);
    b.setUserData(e);
    b.setPosition(x, y);
    b.setDamping(0.1f);
View Full Code Here


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

    e.addToWorld();

    return e;
  }
View Full Code Here

  public static Entity createMammothTank(World world, float x, float y) {
    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "tanks");

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));
View Full Code Here

  public static Entity createMammothTank(World world, float x, float y) {
    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "tanks");

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));
View Full Code Here

    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "tanks");

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));

    Body b = new Body(new Box(125, 104), 1f);
View Full Code Here

    world.getManager(GroupManager.class).add(e, "tanks");

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));

    Body b = new Body(new Box(125, 104), 1f);
    b.setUserData(e);
View Full Code Here

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));

    Body b = new Body(new Box(125, 104), 1f);
    b.setUserData(e);
    b.setPosition(x, y);
View Full Code Here

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));

    Body b = new Body(new Box(125, 104), 1f);
    b.setUserData(e);
    b.setPosition(x, y);
    b.setDamping(0.1f);
View Full Code Here

    b.setPosition(x, y);
    b.setDamping(0.1f);
    b.setRestitution(0);
    b.setRotDamping(50f);
    b.setFriction(100);
    e.addComponent(new Physics(b));

    return e;
  }

  public static Entity createSound(World world, String soundFileName) {
View Full Code Here

    return e;
  }

  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

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.