Package com.tankz.components

Examples of com.tankz.components.SpatialForm


  protected void removed(Entity e) {
    spatials.set(e.getId(), null);
  }

  private Spatial getSpatial(Entity e) {
    SpatialForm spatialForm = spatialFormMapper.get(e);
    String spatialFormFile = spatialForm.getSpatialFormFile();
    if (spatialFormFile.equalsIgnoreCase("crate")) {
      return new Crate(world, e);
    } else if (spatialFormFile.equalsIgnoreCase("mammothTank")) {
      return new MammothTank(world, e);
    } else if (spatialFormFile.equalsIgnoreCase("bullet")) {
View Full Code Here


public class EntityFactory {
  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;
  }
View Full Code Here

  public static Entity createBullet(World world, float x, float y, float angle, Entity shooter) {
    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "bullets");
    Transform transform = new Transform(x, y, angle);
    e.addComponent(transform);
    e.addComponent(new SpatialForm("bullet"));
    e.addComponent(new Expiration(1500));

    Body b = new Body(new Box(10, 10), 0.2f);
    b.setUserData(e);
    b.addExcludedBody(shooter.getComponent(Physics.class).getBody());
View Full Code Here

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

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

    Body b = new Body(new Box(214, 214), 0.3f);
    b.setMoveable(false);
    b.setRotatable(false);
View Full Code Here

  public static Entity createCrate(World world, float x, float y, float angleDeg) {
    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);
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

TOP

Related Classes of com.tankz.components.SpatialForm

Copyright © 2018 www.massapicom. 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.