Package com.badlogic.ashley.benchmark.artemis.components

Examples of com.badlogic.ashley.benchmark.artemis.components.PositionComponent


   
    for (int i = 0; i < numEntities; ++i) {
      Entity entity = world.createEntity();
     
      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);
      }
     
View Full Code Here


    mm = world.getMapper(MovementComponent.class);
  };
 
  @Override
  protected void process(Entity entity) {
    PositionComponent pos = pm.get(entity);
    MovementComponent mov = mm.get(entity);
   
    tmp.set(mov.accel).scl(world.getDelta());
    mov.velocity.add(tmp);
   
View Full Code Here

TOP

Related Classes of com.badlogic.ashley.benchmark.artemis.components.PositionComponent

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.