当前位置: 首页>>代码示例>>Java>>正文


Java GroupManager类代码示例

本文整理汇总了Java中com.artemis.managers.GroupManager的典型用法代码示例。如果您正苦于以下问题:Java GroupManager类的具体用法?Java GroupManager怎么用?Java GroupManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GroupManager类属于com.artemis.managers包,在下文中一共展示了GroupManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMonster

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static Entity createMonster(int x, int y, int level) {
    String id = "monster1";
    switch (MathUtils.random(0, 2)) {
        case 0:
            break;
        case 1:
            id = "monster2";
            break;
        case 2:
            id = "monster3";
            break;
    }

    Entity monster = createTile(x, y, id)
            .addComponent(new Health(level))
            .addComponent(new Level(level))
            .addComponent(new Fightable())
            .addComponent(new Reward(Score.POINTS_MONSTER_KILL))
            .addComponent(new Selectable());
    Tox.world.getManager(GroupManager.class).add(monster, MONSTER_GROUP);
    return monster;
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:23,代码来源:EntityFactory.java

示例2: Game

import com.artemis.managers.GroupManager; //导入依赖的package包/类
@Inject
public Game(NuitToolkit toolkit, DrawSystem drawSystem, IngameInputSystem ingameInputSystem) throws LWJGLException {
    setSystem(ingameInputSystem);
    setSystem(new SpriteAnimateSystem());
    setSystem(new SpritePuppetControlSystem());
    setSystem(new TintMouseSelectionSystem());
    setSystem(drawSystem);
    setSystem(new TriggerSystem());
    setSystem(new TriggerWhenRemovedSystem());
    setSystem(new MainMenuSystem());
    setSystem(new DialogSystem());
    setSystem(new DebugSpriteSystem());
    setManager(new GroupManager());

    initialize();
}
 
开发者ID:devnewton,项目名称:jnuit,代码行数:17,代码来源:Game.java

示例3: createWorld

import com.artemis.managers.GroupManager; //导入依赖的package包/类
private void createWorld() {
	world = new World();
	world.setManager(new GroupManager());
	
	createPlayer();
	world.setSystem(new PlayerRenderSys(game, camera));
	world.setSystem(new SingleSpriteRenderSys(game, camera));
	world.setSystem(new MovementSys());
	world.setSystem(new InputSys(camera));
	world.setSystem(new ShotSys());
	world.setSystem(new EnemySpawnSys());
	world.setSystem(new TargetSys());
	world.setSystem(new CollisionSys(game));
	world.setSystem(new TimeDelSys());
	world.setSystem(new PathFollowSys());
	world.setSystem(new CullingSys());
	world.setSystem(new PlayerBoundSys());
	world.setSystem(new MoveWithPlayerSys(player));
	world.initialize();
}
 
开发者ID:bmaxwell921,项目名称:SwapShip,代码行数:21,代码来源:GameScreen.java

示例4: createBoss

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static void createBoss(World world, Level level) {
	Entity e = createBasicEntity(world,
			MathUtils.random(0, Gdx.graphics.getWidth() - 144),
			Gdx.graphics.getHeight() - 108, 144, 108, 0, 0, 0,
			Constants.Enemy.BASE_HEALTH);
	addShipOffense(world, e, 0, 0, 1, Constants.Enemy.BASE_DAMAGE,
			Constants.Enemy.FIRE_RATE);

	SingleSpriteComp ssc = world.createComponent(SingleSpriteComp.class);
	ssc.name = "Boss1_V2";
	ssc.tint = level.tint;
	e.addComponent(ssc);

	e.addComponent(world.createComponent(NonCullComp.class));

	world.getManager(GroupManager.class).add(e, Constants.Groups.ENEMY);
	e.addToWorld();
}
 
开发者ID:bmaxwell921,项目名称:SwapShip,代码行数:19,代码来源:EntityFactory.java

示例5: createShot

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static void createShot(World world, float x, float y, int damage,
		Color tint, boolean playerShot) {
	Entity e = createBasicEntity(world, x, y, Constants.Shot.WIDTH,
			Constants.Shot.HEIGHT, 0, Constants.Shot.VEL
					* ((playerShot) ? 1 : -1), 0, NO_HEALTH);

	SingleSpriteComp ssc = world.createComponent(SingleSpriteComp.class);
	ssc.name = Constants.Shot.SHOT_NAME;
	ssc.tint = tint;
	e.addComponent(ssc);

	DamageComp dc = world.createComponent(DamageComp.class);
	dc.damage = damage;
	e.addComponent(dc);

	world.getManager(GroupManager.class).add(
			e,
			playerShot ? Constants.Groups.PLAYER_ATTACK
					: Constants.Groups.ENEMY_ATTACK);
	e.addToWorld();
}
 
开发者ID:bmaxwell921,项目名称:SwapShip,代码行数:22,代码来源:EntityFactory.java

示例6: createMissile

import com.artemis.managers.GroupManager; //导入依赖的package包/类
private static void createMissile(World world, float sourceX,
		float sourceY, Entity target) {
	Entity e = createBasicEntity(world, sourceX + Constants.SHIP_WIDTH / 2
			- Constants.Missile.WIDTH / 2, sourceY + Constants.SHIP_HEIGHT,
			Constants.Missile.WIDTH, Constants.Missile.HEIGHT, 0, 0,
			Constants.Missile.VEL, NO_HEALTH);

	DamageComp dc = world.createComponent(DamageComp.class);
	dc.damage = Integer.MAX_VALUE; // Max Value so it's an insta-kill
	e.addComponent(dc);

	TargetComp tc = world.createComponent(TargetComp.class);
	tc.target = target;
	tc.targetGroup = Constants.Groups.ENEMY;
	e.addComponent(tc);

	SingleSpriteComp ssc = world.createComponent(SingleSpriteComp.class);
	ssc.name = Constants.Missile.NAME;
	ssc.tint = Color.WHITE;
	e.addComponent(ssc);

	world.getManager(GroupManager.class).add(e,
			Constants.Groups.PLAYER_ATTACK);
	e.addToWorld();
}
 
开发者ID:bmaxwell921,项目名称:SwapShip,代码行数:26,代码来源:EntityFactory.java

示例7: createEffect

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static Entity createEffect(World world, float x, float y) {
	Entity e = world.createEntity();
	
	Position position = new Position();
	position.setX(x);
	position.setY(y);
	e.addComponent(position);
	
	Velocity velocity = new Velocity();
	velocity.setX(-150 * Constants.ZOOM);
	e.addComponent(velocity);
	
	Effect effect = new Effect("pixel2");
	e.addComponent(effect);
	
       world.getManager(GroupManager.class).add(e, Constants.Groups.EFFECT);
       
	return e;
}
 
开发者ID:matachi,项目名称:skuttande-nyan-cat,代码行数:20,代码来源:EntityFactory.java

示例8: createEffect2

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static Entity createEffect2(World world, float x, float y) {
	Entity e = world.createEntity();
	
	Position position = new Position();
	position.setX(x);
	position.setY(y);
	e.addComponent(position);
	
	Velocity velocity = new Velocity();
	velocity.setX(-150 * Constants.ZOOM);
	e.addComponent(velocity);
	
	Effect effect = new Effect("lines");
	e.addComponent(effect);
	
       world.getManager(GroupManager.class).add(e, Constants.Groups.EFFECT);
       
	return e;
}
 
开发者ID:matachi,项目名称:skuttande-nyan-cat,代码行数:20,代码来源:EntityFactory.java

示例9: GameScreen

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public GameScreen() {
  world = new World();
  world.setManager(new GroupManager());
  world.setSystem(new PlayerGameInputSystem());    
  world.setSystem(new MovementSystem());
  world.setSystem(new OffScreenEntityRemovingSystem());
  world.setSystem(new PlayerScreenBoundingSystem());
  world.setSystem(new BoundsUpdatingSystem());
  world.setSystem(new RandomEnemySpawningIntervalSystem());
  world.setSystem(new CollisionSystem());
  world.setSystem(new FPSConsoleLoggingSystem());
  
  imageRenderer = world.setSystem(new ImageRenderingSystem(TARGET_PPUX, TARGET_PPUY), true);
  explosionRenderer = world.setSystem(new ExplosionRenderingSystem(TARGET_PPUX, TARGET_PPUY), true);
  world.initialize();
  EntityFactory.createSpaceship(world, CAM_WIDTH / 2f, SHIP_HEIGHT).addToWorld();
  Assets.loadImages();
}
 
开发者ID:jamiltron,项目名称:entity-shmup,代码行数:19,代码来源:GameScreen.java

示例10: createConcealment

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public static Entity createConcealment(int x, int y, Entity concealedEntity) {
    Entity conceal = createTile(x, y, "mystery", Animation.Layer.TILE_COVER)
            .addComponent(new Selectable())
            .addComponent(new Conceal(concealedEntity));
    Tox.world.getManager(GroupManager.class).add(conceal, CONCEAL_GROUP);
    return conceal;
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:8,代码来源:EntityFactory.java

示例11: getClearLevel

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public int getClearLevel() {

        ImmutableBag<Entity> groups = Tox.world.getManager(GroupManager.class).getEntities(EntityFactory.MONSTER_GROUP);

        if ( groups.size() >= 15 ) return 0;
        if ( groups.size() > 12 ) return 1;
        if ( groups.size() > 0 ) return 2;
        return 3;
    }
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:10,代码来源:GameScreen.java

示例12: updateMonsters

import com.artemis.managers.GroupManager; //导入依赖的package包/类
private void updateMonsters(ToxResource.Universe universe, int levelChange) {
    ImmutableBag<Entity> monsters = Tox.world.getManager(GroupManager.class).getEntities("monster");
    for (Entity monster : monsters) {
        if (am.has(monster)) {
            final Animation animation = am.get(monster);

            String vanillaSfx = "tox_sfx_grunt_male" + MathUtils.random(1, 3);

            if (animation.id.equals("monster1")) { fm.get(monster).deathSfx= universe == ToxResource.Universe.BUNNY ? "tox_sfx_bunny_dies" : universe == ToxResource.Universe.PHASE ? "tox_sfx_monster_dies1" : vanillaSfx;  }
            if (animation.id.equals("monster2")) { fm.get(monster).deathSfx= universe == ToxResource.Universe.BUNNY ? "tox_sfx_wasp_dies" :  universe == ToxResource.Universe.PHASE ? "tox_sfx_monster_dies2" :vanillaSfx;  }
            if (animation.id.equals("monster3")) { fm.get(monster).deathSfx= universe == ToxResource.Universe.BUNNY ? "tox_sfx_octopus_dies" : universe == ToxResource.Universe.PHASE ? "tox_sfx_monster_dies3" :vanillaSfx;  }
        }

        Level level = lem.get(monster);
        level.level += levelChange;

        Position pos = pm.get(monster);
        particleSystem.cloud(
                (int) (pos.x + Animation.DEFAULT_SCALE * ToxResource.TILE_SIZE * 0.5f),
                (int) (pos.y + Animation.DEFAULT_SCALE * ToxResource.TILE_SIZE * 0.5f), ToxResource.TILE_SIZE);

        // healthup with levelup!
        if (hm.has(monster)) {
            Health health = hm.get(monster);
            health.maxHealth = level.level;
        }

    }
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:30,代码来源:UniverseSystem.java

示例13: activatePhase

import com.artemis.managers.GroupManager; //导入依赖的package包/类
private void activatePhase() {
    ImmutableBag<Entity> conceals = Tox.world.getManager(GroupManager.class).getEntities(EntityFactory.CONCEAL_GROUP);
    for (Entity conceal : conceals) {
        concealSystem.unconceal(conceal, false);
    }

    Tox.resource.loadUniverse(ToxResource.Universe.PHASE);
    world.getSystem(PetalSystem.class).setEnabled(false);
}
 
开发者ID:DaanVanYperen,项目名称:tox,代码行数:10,代码来源:UniverseSystem.java

示例14: Overworld

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public Overworld() {
  assetManager = new AssetManager();

  camera = new HelixCamera(60, new Vector3(0, -30, 30), .01f, 300);

  WorldConfiguration worldConfiguration 
      = new WorldConfiguration().register(assetManager)
                                .register(camera);
  world = new World(worldConfiguration);

  world.setManager(new UuidEntityManager());
  world.setManager(new TextureManager());
  world.setManager(new TagManager());
  world.setManager(new GroupManager());
  world.setManager(new AreaManager());
  world.setManager(new WeatherMan());
  world.setManager(new LocalAmbienceManager());
  world.setManager(displayableIntermediary = new DisplayableIntermediary());
  world.setManager(cameraIntermediary = new CameraIntermediary());

  world.setSystem(new CameraControlSystem());
  world.setSystem(new TileHighlightingSystem());
  world.setSystem(new TilePermissionsEditingSystem());
  world.setSystem(new RenderingSystem());

  world.initialize();
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:28,代码来源:Overworld.java

示例15: Overworld

import com.artemis.managers.GroupManager; //导入依赖的package包/类
public Overworld() {
  assetManager = new AssetManager();

  camera = new HelixCamera(30, new Vector3(16, 16, 0), .1f, 35);

  WorldConfiguration worldConfiguration 
      = new WorldConfiguration().register(assetManager)
                                .register(camera);

  world = new World(worldConfiguration);

  world.setSystem(new PlayerMovementSystem());
  world.setSystem(new CameraClientsUpdateSystem());
  world.setSystem(new AnimationProcessingSystem());
  world.setSystem(new RenderingSystem());
  world.setSystem(new ScreenFadingSystem());

  world.setManager(new UuidEntityManager());
  world.setManager(new TextureManager());
  world.setManager(new GroupManager());
  world.setManager(new TagManager());
  world.setManager(new AreaManager());
  world.setManager(new PlayerManager());
  world.setManager(new LocalAmbienceManager());
  world.setManager(new WeatherMan());
  world.initialize();

  world.getManager(WeatherMan.class)
       .setToType(WeatherMan.WeatherType.SUNNY);
  world.getManager(AreaManager.class).load("area1");
  // Temporary
  world.getManager(LocalAmbienceManager.class)
       .setAmbience(world.getManager(WeatherMan.class).getWeather());
}
 
开发者ID:fauu,项目名称:HelixEngine,代码行数:35,代码来源:Overworld.java


注:本文中的com.artemis.managers.GroupManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。