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


Java Timer.start方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.utils.Timer.start方法的典型用法代碼示例。如果您正苦於以下問題:Java Timer.start方法的具體用法?Java Timer.start怎麽用?Java Timer.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.utils.Timer的用法示例。


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

示例1: VindicetisExSimius

import com.badlogic.gdx.utils.Timer; //導入方法依賴的package包/類
public VindicetisExSimius(final TriviazoGame game) {
    super(game);
    game.getMusicManager().play(TriviazoMusic.TENSION_IS_RISING);
    timer = new Timer();
    timer.scheduleTask(task, 0F, intervalSeconds);
    timer.start();
}
 
開發者ID:sTorro,項目名稱:triviazo,代碼行數:8,代碼來源:VindicetisExSimius.java

示例2: TempusFugit

import com.badlogic.gdx.utils.Timer; //導入方法依賴的package包/類
public TempusFugit(final TriviazoGame game) {
    super(game);
    game.getMusicManager().play(TriviazoMusic.TENSION_IS_RISING);
    timer = new Timer();
    timer.scheduleTask(task, delaySeconds, intervalSeconds);
    timer.start();
}
 
開發者ID:sTorro,項目名稱:triviazo,代碼行數:8,代碼來源:TempusFugit.java

示例3: GameStage

import com.badlogic.gdx.utils.Timer; //導入方法依賴的package包/類
/**
 * Constructor for GameStage.
 * @param width width of the game stage viewport in pixels
 * @param height height of the game stage viewport in pixels
 * @param levelWidth game world/level width
 */
public GameStage(float width, float height, float levelWidth) {
    super(width, height, false);
    world = new World(new Vector2(0.0f, -9.8f), true);
    /* TODO It seems that there is some strange static data inside the
     * world which doesn't get cleared even after this stage and world
     * declared here are disposed. This seems to cause strange
     * (gravitational?) forces when new world is created and disposed
     * few times.
     *
     *  This could be also a result of varying fps during start up. */
    world.setWarmStarting(true);
    itemDestructor = new ItemDestructionList();
    this.levelWidth = levelWidth;

    /* Timer is used to implement a short delay between start of
     * physics modeling and damage modeling to allow bodies hit the ground
     * without any damage. */
    Timer.Task timTsk = new SetModelContactListener();
    Timer tim = new Timer();
    tim.scheduleTask(timTsk, 3.0f); /* sec */
    tim.start();

    if (G.DEBUG) {
        renderer = new Box2DDebugRenderer(true, true, true, true, true);
        debugCamera = new OrthographicCamera(
                this.getWidth() * G.WORLD_TO_BOX,
                this.getHeight() * G.WORLD_TO_BOX);
        renderer.setDrawAABBs(false);
        renderer.setDrawJoints(true);
        renderer.setDrawVelocities(true);
        renderer.setDrawBodies(true);

        Vector3 pos = this.getCamera().position;
        debugCamera.position.set(pos.x*G.WORLD_TO_BOX, pos.y*G.WORLD_TO_BOX, 0);
        debugCamera.update();
    }
}
 
開發者ID:OlliV,項目名稱:angr,代碼行數:44,代碼來源:GameStage.java

示例4: start

import com.badlogic.gdx.utils.Timer; //導入方法依賴的package包/類
public void start() {
    timeTimer = new Timer();
    timeTimer.start();
    timeTimer.scheduleTask(timeTask, time / 1000f);
    this.timeToFinish = timeTask.getExecuteTimeMillis() - System.nanoTime() / 1000000;
}
 
開發者ID:delphikettle,項目名稱:libgdxGP,代碼行數:7,代碼來源:TimeTask.java


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