Package com.artemis

Examples of com.artemis.Entity.addComponent()


     
      if (Constants.shouldHaveComponent(ComponentType.POSITION, i)) {
        PositionComponent pos = new PositionComponent();
        pos.pos.x = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
        pos.pos.y = MathUtils.random(Constants.MIN_POS, Constants.MAX_POS);
        entity.addComponent(pos);
      }
     
      if (Constants.shouldHaveComponent(ComponentType.MOVEMENT, i)) {
        MovementComponent mov = new MovementComponent();
        mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
View Full Code Here


        mov.velocity.x = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
        mov.velocity.y = MathUtils.random(Constants.MIN_VEL, Constants.MAX_VEL);
        mov.accel.x = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
        mov.accel.y = MathUtils.random(Constants.MIN_ACC, Constants.MAX_ACC);
       
        entity.addComponent(mov);
      }
     
      if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
        RadiusComponent rad = new RadiusComponent();
        rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
View Full Code Here

      }
     
      if (Constants.shouldHaveComponent(ComponentType.RADIUS, i)) {
        RadiusComponent rad = new RadiusComponent();
        rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
        entity.addComponent(rad);
      }
     
      if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
        entity.addComponent(new StateComponent());
      }
View Full Code Here

        rad.radius = MathUtils.random(Constants.MIN_RADIUS, Constants.MAX_RADIUS);
        entity.addComponent(rad);
      }
     
      if (Constants.shouldHaveComponent(ComponentType.STATE, i)) {
        entity.addComponent(new StateComponent());
      }
     
      world.addEntity(entity);
    }
   
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.