當前位置: 首頁>>代碼示例>>Java>>正文


Java FramesConfig類代碼示例

本文整理匯總了Java中com.b3dgs.lionengine.game.FramesConfig的典型用法代碼示例。如果您正苦於以下問題:Java FramesConfig類的具體用法?Java FramesConfig怎麽用?Java FramesConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FramesConfig類屬於com.b3dgs.lionengine.game包,在下文中一共展示了FramesConfig類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Entity

import com.b3dgs.lionengine.game.FramesConfig; //導入依賴的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: EffectModel

import com.b3dgs.lionengine.game.FramesConfig; //導入依賴的package包/類
/**
 * Create an effect.
 * 
 * @param setup The setup reference.
 */
EffectModel(Setup setup)
{
    super();

    final FramesConfig config = FramesConfig.imports(setup);
    surface = Drawable.loadSpriteAnimated(setup.getSurface(), config.getHorizontal(), config.getVertical());
    surface.setOrigin(Origin.MIDDLE);
}
 
開發者ID:b3dgs,項目名稱:tyrian-remake,代碼行數:14,代碼來源:EffectModel.java

示例3: ProjectileModel

import com.b3dgs.lionengine.game.FramesConfig; //導入依賴的package包/類
/**
 * Create a projectile model.
 * 
 * @param setup The setup reference.
 */
ProjectileModel(Setup setup)
{
    super();

    final FramesConfig frames = FramesConfig.imports(setup);
    surface = Drawable.loadSpriteAnimated(setup.getSurface(), frames.getHorizontal(), frames.getVertical());
    surface.setFrame(setup.getInteger(ATT_FRAME, SurfaceConfig.NODE_SURFACE));
    surface.setOrigin(Origin.MIDDLE);

    effectRate = setup.getIntegerDefault(0, ATT_RATE, NODE_EFFECT);
    if (setup.getRoot().hasChild(NODE_EFFECT))
    {
        effectMedia = Medias.create(setup.getText(NODE_EFFECT));
    }
    else
    {
        effectMedia = null;
    }

    final Xml root = setup.getRoot();
    if (root.hasChild(ForceConfig.NODE_FORCE))
    {
        acceleration = ForceConfig.imports(root);
    }
    else
    {
        acceleration = new Force();
    }
}
 
開發者ID:b3dgs,項目名稱:tyrian-remake,代碼行數:35,代碼來源:ProjectileModel.java


注:本文中的com.b3dgs.lionengine.game.FramesConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。