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


Java Services.get方法代码示例

本文整理汇总了Java中com.b3dgs.lionengine.game.Services.get方法的典型用法代码示例。如果您正苦于以下问题:Java Services.get方法的具体用法?Java Services.get怎么用?Java Services.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.b3dgs.lionengine.game.Services的用法示例。


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

示例1: Entity

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create an entity.
 * 
 * @param services The services reference.
 * @param setup The setup used.
 * @throws LionEngineException If error.
 */
public Entity(Services services, SetupSurfaceRastered setup)
{
    super();

    final FramesConfig frames = FramesConfig.imports(setup);
    surface = Drawable.loadSpriteAnimated(setup.getSurface(), frames.getHorizontal(), frames.getVertical());

    tileCollidable = addFeatureAndGet(new TileCollidableModel(services, setup));

    body.setMass(2.0);
    body.setGravityMax(7.0);
    body.setDesiredFps(60);
    body.setVectors(movement, jump);

    viewer = services.get(Viewer.class);

    StateAnimationBased.Util.loadStates(EntityState.values(), stateFactory, this, setup);

    stateHandler.addInput(getInput());
    stateHandler.changeState(EntityState.IDLE);
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:29,代码来源:Entity.java

示例2: EntityStats

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create icon provider.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public EntityStats(Services services, Setup setup)
{
    super();

    text = services.get(Text.class);

    name = setup.getString("name");
    final Media media = setup.getIconFile();
    if (media != null)
    {
        icon = Drawable.loadImage(media);
        icon.load();
        icon.setLocation(Constant.ENTITY_INFO_X + ENTITY_INFO_MARGIN, Constant.ENTITY_INFO_Y + ENTITY_INFO_MARGIN);
    }
    else
    {
        icon = null;
    }
    life.fill();
    barLife.setColorForeground(COLOR_LIFE);
    barLife.setLocation((int) (icon.getX() + BAR_LIFE_X), (int) (icon.getY() + BAR_LIFE_Y));
}
 
开发者ID:b3dgs,项目名称:warcraft-remake,代码行数:29,代码来源:EntityStats.java

示例3: Effect

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create an effect.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public Effect(Services services, Setup setup)
{
    super(services, setup);

    viewer = services.get(Viewer.class);

    addFeature(new Recycler());
    addFeature(new LayerableModel(Constant.LAYER_EFFECT));
    transformable = addFeatureAndGet(new TransformableModel(setup));

    final EffectModel model = addFeatureAndGet(new EffectModel(setup));
    addFeature(new EffectUpdater(services, model));
    addFeature(new EffectRenderer(model));

    anim = AnimationConfig.imports(setup).getAnimation("start");
    surface = model.getSurface();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:24,代码来源:Effect.java

示例4: ChangeWeapon

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create power up action.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public ChangeWeapon(Services services, Setup setup)
{
    super();

    factory = services.get(Factory.class);

    if (setup.hasNode(NODE_WEAPON_FRONT))
    {
        media = Medias.create(Constant.FOLDER_WEAPON,
                              Constant.FOLDER_FRONT,
                              setup.getText(NODE_WEAPON_FRONT) + Factory.FILE_DATA_DOT_EXTENSION);
    }
    else if (setup.hasNode(NODE_WEAPON_REAR))
    {
        media = Medias.create(Constant.FOLDER_WEAPON,
                              Constant.FOLDER_REAR,
                              setup.getText(NODE_WEAPON_REAR) + Factory.FILE_DATA_DOT_EXTENSION);
    }
    else
    {
        media = null;
    }
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:30,代码来源:ChangeWeapon.java

示例5: MarioUpdater

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create updater.
 * 
 * @param services The services reference.
 * @param model The model reference.
 */
public MarioUpdater(Services services, MarioModel model)
{
    context = services.get(Context.class);

    movement = model.getMovement();
    jump = model.getJump();
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:14,代码来源:MarioUpdater.java

示例6: MarioRenderer

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Constructor.
 * 
 * @param services The services reference.
 * @param model The model reference.
 */
public MarioRenderer(Services services, MarioModel model)
{
    super();

    viewer = services.get(Viewer.class);
    surface = model.getSurface();
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:14,代码来源:MarioRenderer.java

示例7: MarioController

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create updater.
 * 
 * @param services The services reference.
 * @param model The model reference.
 */
public MarioController(Services services, MarioModel model)
{
    movement = model.getMovement();
    jump = model.getJump();
    keyboard = services.get(Keyboard.class);
}
 
开发者ID:b3dgs,项目名称:lionheart-remake,代码行数:13,代码来源:MarioController.java

示例8: ShipControllerAndroid

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create an Android ship controller.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public ShipControllerAndroid(Services services, Setup setup)
{
    super();

    mouse = services.get(Mouse.class);
    camera = services.get(Camera.class);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:14,代码来源:ShipControllerAndroid.java

示例9: EntityRenderer

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create an entity renderer.
 * 
 * @param services The services reference.
 */
EntityRenderer(Services services)
{
    super();

    viewer = services.get(Viewer.class);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:12,代码来源:EntityRenderer.java

示例10: Shooter

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create a shooter.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
Shooter(Services services, Setup setup)
{
    super();

    factory = services.get(Factory.class);
    ship = services.get(ShipUpdater.class);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:14,代码来源:Shooter.java

示例11: ShipControllerPc

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create a PC ship controller.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public ShipControllerPc(Services services, Setup setup)
{
    super();

    context = services.get(Context.class);
    mouse = services.get(Mouse.class);
    camera = services.get(Camera.class);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:15,代码来源:ShipControllerPc.java

示例12: Ship

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create ship.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
public Ship(Services services, Setup setup)
{
    super();

    this.services = services;
    viewer = services.get(Viewer.class);

    y = UtilRandom.getRandomInteger(RANDOM_Y);
    follow = UtilRandom.getRandomBoolean();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:17,代码来源:Ship.java

示例13: ShipUpdater

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create a ship renderer.
 * 
 * @param services The services reference.
 * @param setup The setup reference.
 */
ShipUpdater(Services services, Setup setup)
{
    super();

    context = services.get(Context.class);
    sequence = services.get(Sequencer.class);
    factory = services.get(Factory.class);
    handler = services.get(Handler.class);
    camera = services.get(Camera.class);

    shieldIncTick.start();
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:19,代码来源:ShipUpdater.java

示例14: Hud

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create HUD.
 * 
 * @param services The services reference.
 */
public Hud(Services services)
{
    super();

    camera = services.get(Camera.class);
    map = services.get(MapTile.class);

    surface.load();
    surface.prepare();
    surface.setLocation(0.0, services.get(Viewer.class).getHeight() - surface.getHeight());

    shipUpdater = services.get(ShipUpdater.class);
    ship = shipUpdater.getFeature(ShipModel.class);

    shield.setLocation(4, 305);
    shield.setColor(ColorRgba.BLACK, ColorRgba.BLUE);

    armor.setLocation(4, 342);
    armor.setColor(ColorRgba.BLACK, BROWN);

    energy.setLocation(100, 303);
    energy.setColorBackground(ColorRgba.BLACK);
    energy.setColorGradient(ColorRgba.RED, ColorRgba.YELLOW);

    levelFront.setLocation(190, 319);
    levelFront.setColorBackground(ColorRgba.BLACK);
    levelFront.setColorGradient(ColorRgba.YELLOW, ColorRgba.RED);

    levelRear.setLocation(190, 335);
    levelRear.setColorBackground(ColorRgba.BLACK);
    levelRear.setColorGradient(ColorRgba.YELLOW, ColorRgba.RED);

    progress.setLocation(73, 302);
    progress.setColorGradient(ColorRgba.GREEN, ColorRgba.RED);
}
 
开发者ID:b3dgs,项目名称:tyrian-remake,代码行数:41,代码来源:Hud.java

示例15: World

import com.b3dgs.lionengine.game.Services; //导入方法依赖的package包/类
/**
 * Create the world.
 * 
 * @param context The context reference.
 * @param services The services reference.
 */
public World(Context context, Services services)
{
    super(context, services);

    final Resolution source = context.getConfig().getSource();
    camera.setView(VIEW_X, VIEW_Y, source.getWidth() - VIEW_X, source.getHeight() - VIEW_Y, source.getHeight());

    handler.addComponent(new ComponentCollision());

    map.addFeature(new MapTileViewerModel(services));
    map.addFeature(new MapTilePersisterModel(services));
    map.addFeature(new MapTileGroupModel());
    map.addFeature(new MapTilePathModel(services));
    handler.add(map);

    final Hud hud = factory.create(Medias.create("Hud.xml"));
    handler.add(hud);

    final Selector selector = services.get(Selector.class);
    selector.addFeature(new LayerableModel(Constant.LAYER_SELECTION, Constant.LAYER_SELECTION_RENDER));
    selector.setClickableArea(camera);
    selector.setSelectionColor(ColorRgba.GREEN);
    selector.setClickSelection(Mouse.LEFT);
    selector.getFeature(Collidable.class).addAccept(Constant.LAYER_ENTITY);

    text.setLocation(TEXT_X, TEXT_Y);
    text.setColor(TEXT_COLOR);

    services.add(Integer.valueOf(source.getRate()));
}
 
开发者ID:b3dgs,项目名称:warcraft-remake,代码行数:37,代码来源:World.java


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