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


Java ITimerCallback类代码示例

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


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

示例1: score

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
private void score() {
	mScoreText.setScale(2f);
	mScore += PIPE_PASSING_SCORE[ CURRENT_LEVEL ] ; 
	mScorePipeSound.play();
	updateScore();
	mTimer = new TimerHandler(0.5f, false, new ITimerCallback() {
		@Override
		public void onTimePassed(final TimerHandler pTimerHandler) {
			
			mScoreText.reset();
			mScene.unregisterUpdateHandler(mTimer);
			
		}
	});
	mScene.registerUpdateHandler(mTimer);
}
 
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:17,代码来源:MainActivity.java

示例2: scoreBaap

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
private void scoreBaap() {
	mScoreText.setScale(2f);
	
	mScore += COIN_POINT[CURRENT_LEVEL];
	mScoreCoinSound.play();
	updateScore();
	
	mTimer = new TimerHandler(0.5f, false, new ITimerCallback() {
		@Override
		public void onTimePassed(final TimerHandler pTimerHandler) {
			
			mScoreText.reset();
			mScene.unregisterUpdateHandler(mTimer);
			
		}
	});
	mScene.registerUpdateHandler(mTimer);
}
 
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:19,代码来源:MainActivity.java

示例3: dead

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
private void dead() {
	GAME_STATE = STATE_DEAD;

	mTimer = new TimerHandler(1.6f, false, new ITimerCallback() {
		@Override
		public void onTimePassed(final TimerHandler pTimerHandler) {
			mYouSuckText.reset();
			mScene.detachChild(mYouSuckText);
			restartGame();
			mScene.unregisterUpdateHandler(mTimer);

		}
	});

	mScene.registerUpdateHandler(mTimer);
}
 
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:17,代码来源:MainActivity.java

示例4: onCreateScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
protected Scene onCreateScene() {
    createHelpDialog();
    mMainScene = new GameScene(mResourceManager, mCamera, this);
    mMainScene.initViews(mResourceManager, mCamera);
    mMainScene.updateLevel(mLevel);
    mMainScene.setOnAreaTouchListener(this);
    mRacer = mMainScene.mRacer;
    mRacer.setX(LEFT_OFFSET);
    mLevelHandler = new TimerHandler(45.0f, true, new ITimerCallback() {

        @Override
        public void onTimePassed(TimerHandler pTimerHandler) {
            mEngine.getEngineLock().lock();
            if (mLevel <= 15)
                mLevel += 1;

            mMainScene.updateLevel(mLevel);
            mEngine.getEngineLock().unlock();
        }
    });

    return mMainScene;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:25,代码来源:GameActivity.java

示例5: prepareScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public Scene prepareScene() {
    Scene scene = activity.getScene();

    final Background backgroundColor = new Background(0.84706f, 0.64706f, 0.84314f);
    scene.setBackground(backgroundColor);

    resetGamePoints();
    createCards();

    scene.setTouchAreaBindingOnActionDownEnabled(true);

    TimerHandler myTimer = new TimerHandler(1, true, new ITimerCallback() {
        public void onTimePassed(TimerHandler pTimerHandler) {
            decrementTime();
        }
    });
    scene.registerUpdateHandler(myTimer);
    return scene;
}
 
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:21,代码来源:PictoGame.java

示例6: updateGameScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void updateGameScene() {

    if (gameService.solvedPuzzle()) {
        setOnSceneTouchListener(null);
        gameService.detatch(this);
        baseScene.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                    @Override
                    public void onTimePassed(final TimerHandler pTimerHandler) {

                        baseScene.unregisterUpdateHandler(pTimerHandler);
                        onSolvedGame();
                    }
                }));
    }

    scoreText.setText(String.valueOf(gameService.getLevel().getMovesCount()));

    updateTiles(gameService.solvedPuzzle());
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:22,代码来源:GameScene.java

示例7: onSolvedGame

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void onSolvedGame() {

    restartButton.setVisible(false);

    Level level = gameService.getLevel();
    final LevelResult levelResult = levelService.calculateLevelResult(level);
    levelService.persistLevelResult(levelResult);

    int nextLevelId = level.getId() + 1;
    levelService.unlockLevel(nextLevelId);
    this.leaveScene = true;
    engine.registerUpdateHandler(new TimerHandler(1.5f, new ITimerCallback() {

                @Override
                public void onTimePassed(TimerHandler pTimerHandler) {

                    engine.unregisterUpdateHandler(pTimerHandler);
                    storyService.loadScoreScreen(levelResult);
                }
            }));
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:23,代码来源:LevelModeGameScene.java

示例8: start

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void start() {

    this.justPlayService = new JustPlayServiceImpl();
    engine.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                @Override
                public void onTimePassed(final TimerHandler pTimerHandler) {

                    engine.unregisterUpdateHandler(pTimerHandler);
                    ResourcesManager.getInstance().loadGameSceneResources();
                    ResourcesManager.getInstance().loadJustPlayScoreResources();
                    justPlayGameScene = new JustPlayGameScene(justPlayService.getNextLevel());
                    setScene(justPlayGameScene);
                }
            }));
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:18,代码来源:JustPlaySceneServiceImpl.java

示例9: loadJustPlaySceneFromJustPlayScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void loadJustPlaySceneFromJustPlayScene(final TimeBasedGameService timeBasedGameService,
    final JustPlayLevel justPlayLevel) {

    engine.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                @Override
                public void onTimePassed(final TimerHandler pTimerHandler) {

                    engine.unregisterUpdateHandler(pTimerHandler);
                    justPlayGameScene.disposeScene();
                    justPlayGameScene = new JustPlayGameScene(timeBasedGameService, justPlayLevel);
                    setScene(justPlayGameScene);
                }
            }));
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:17,代码来源:JustPlaySceneServiceImpl.java

示例10: onBackKeyPressed

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void onBackKeyPressed() {

    if (!leaveScene) {
        leaveScene = true;
        engine.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                    @Override
                    public void onTimePassed(TimerHandler pTimerHandler) {

                        engine.unregisterUpdateHandler(pTimerHandler);
                        storyService.loadMenuSceneFromJustPlayGameScene();
                    }
                }));
    }
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:17,代码来源:JustPlayGameScene.java

示例11: onSolvedGame

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void onSolvedGame() {

    timeBasedGameService.stop();
    restartButton.setVisible(false);

    if (!leaveScene) {
        restartButton.setEnabled(false);
        leaveScene = true;
        engine.registerUpdateHandler(new TimerHandler(1f, new ITimerCallback() {

                    @Override
                    public void onTimePassed(TimerHandler pTimerHandler) {

                        engine.unregisterUpdateHandler(pTimerHandler);
                        storyService.loadJustPlayScoreSceneFromJustPlayScene(
                            new JustPlayLevelResult(timeBasedGameService.getRemainingTime(),
                                gameService.getLevel().getMovesCount(),
                                gameService.getLevel().getMinimumMovesToSolve()));
                    }
                }));
    }
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:24,代码来源:JustPlayGameScene.java

示例12: updateJustPlayScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void updateJustPlayScene() {

    engine.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                @Override
                public void onTimePassed(TimerHandler pTimerHandler) {

                    leftTime.setText(String.valueOf(timeBasedGameService.getRemainingTime()));

                    if (timeBasedGameService.getRemainingTime() <= 5) {
                        backgroundFlash();
                    }
                }
            }));

    if (timeBasedGameService.getRemainingTime() == 0 && !gameService.solvedPuzzle()) {
        onLostGame();
    }
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:21,代码来源:JustPlayGameScene.java

示例13: addAnimation

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
private void addAnimation(final int[] currentScore) {

        engine.registerUpdateHandler(new TimerHandler(0.01f, true, new ITimerCallback() {

                    @Override
                    public void onTimePassed(TimerHandler pTimerHandler) {

                        if (!leaveScene) {
                            if (currentScore[0] >= justPlayResult.getScore()) {
                                score.setText(String.valueOf(justPlayResult.getScore()));
                                engine.unregisterUpdateHandler(pTimerHandler);
                            } else {
                                currentScore[0]++;
                                score.setText(String.valueOf(currentScore[0]));
                            }
                        } else {
                            engine.unregisterUpdateHandler(pTimerHandler);
                        }
                    }
                }));
        registerEntityModifier(new MoveYModifier(0.15f, -camera.getHeight(), 0, EaseQuadInOut.getInstance()));
    }
 
开发者ID:djschilling,项目名称:sopa,代码行数:23,代码来源:JustPlayLostScene.java

示例14: addAnimation

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
private void addAnimation(final int[] currentScore) {

        float stepRange = 0.5f / (justPlayResult.getScore() - justPlayResult.getLastScore());
        engine.registerUpdateHandler(new TimerHandler(stepRange, true, new ITimerCallback() {

                    @Override
                    public void onTimePassed(TimerHandler pTimerHandler) {

                        if (!leaveScene) {
                            if (currentScore[0] >= justPlayResult.getScore()) {
                                score.setText(String.valueOf(justPlayResult.getScore()));
                                engine.unregisterUpdateHandler(pTimerHandler);
                            } else {
                                currentScore[0]++;
                                score.setText(String.valueOf(currentScore[0]));
                            }
                        } else {
                            engine.unregisterUpdateHandler(pTimerHandler);
                        }
                    }
                }));
        registerEntityModifier(new MoveYModifier(0.15f, -camera.getHeight(), 0, EaseQuadInOut.getInstance()));
    }
 
开发者ID:djschilling,项目名称:sopa,代码行数:24,代码来源:JustPlayScoreScene.java

示例15: disposeScene

import org.andengine.engine.handler.timer.ITimerCallback; //导入依赖的package包/类
@Override
public void disposeScene() {

    camera.setChaseEntity(null);
    camera.setCenter(camera.getWidth() / 2, camera.getHeight() / 2);
    rightArrow.setVisible(false);
    leftArrow.setVisible(false);
    camera.setHUD(null);

    final LevelChoiceScene levelChoiceScene = this;
    engine.registerUpdateHandler(new TimerHandler(0.1f, new ITimerCallback() {

                @Override
                public void onTimePassed(final TimerHandler pTimerHandler) {

                    engine.unregisterUpdateHandler(pTimerHandler);
                    arrowHud.detachChildren();
                    levelChoiceScene.detachChildren();
                }
            }));
}
 
开发者ID:djschilling,项目名称:sopa,代码行数:22,代码来源:LevelChoiceScene.java


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