Code refactoring.

master
Vectozavr 2021-10-17 23:42:02 +07:00
parent dd5a9f3ef2
commit 00c3943eae
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ void PlayerController::update() {
Keyboard::isKeyPressed(sf::Keyboard::S)); Keyboard::isKeyPressed(sf::Keyboard::S));
std::shared_ptr<Object> camera = _player->attached(ObjectNameTag("camera")); std::shared_ptr<Object> camera = _player->attached(ObjectNameTag("camera"));
if(camera != nullptr && _inRunning) { if(camera != nullptr && _inRunning && _player->inCollision()) {
if (!Timeline::isInAnimList(AnimationListTag("camera_hor_oscil"))) { if (!Timeline::isInAnimList(AnimationListTag("camera_hor_oscil"))) {
Timeline::animate(AnimationListTag("camera_hor_oscil"), new ATranslate(camera, -camera->left() / 6, 0.3,Animation::LoopOut::None, Animation::InterpolationType::cos)); Timeline::animate(AnimationListTag("camera_hor_oscil"), new ATranslate(camera, -camera->left() / 6, 0.3,Animation::LoopOut::None, Animation::InterpolationType::cos));
Timeline::animate(AnimationListTag("camera_hor_oscil"), new AWait(0)); Timeline::animate(AnimationListTag("camera_hor_oscil"), new AWait(0));