示例#1
0
void PlayerController::activateAdrenalineEffect() {
    GameWorld* world = character->engine;
    GameState* state = character->engine->state;

    adrenalineEffect = true;
    adrenalineEffectTime = world->getGameTime() + 20.f;
    state->basic.timeScale = 0.3f;
}
示例#2
0
void PlayerController::update(float dt) {
    restartLogic();

    GameWorld* world = character->engine;
    GameState* state = character->engine->state;

    if (adrenalineEffect) {
        if (world->getGameTime() > adrenalineEffectTime) {
            state->basic.timeScale = 1.f;
            adrenalineEffect = false;
        }
    }

    CharacterController::update(dt);
}