From 265782fe8663cb3b4c6db808395ffb4e103f49f4 Mon Sep 17 00:00:00 2001 From: serk Date: Sun, 22 Jan 2017 01:52:13 +0100 Subject: [PATCH] burbukas --- VaporWaveWars/actor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/VaporWaveWars/actor.cpp b/VaporWaveWars/actor.cpp index e149e0b..0237a9c 100644 --- a/VaporWaveWars/actor.cpp +++ b/VaporWaveWars/actor.cpp @@ -26,6 +26,10 @@ bool Actor::update(float deltaTime, sf::RenderWindow *window) { else if (animate == PlayerState::inMidle) { if (character->isLastFrame()) animate = PlayerState::idle; } + else if (animate == PlayerState::success) { + character->setState(PlayerState::success); + animate = PlayerState::inMidle; + } return this->updateLogic(deltaTime, window); } @@ -35,7 +39,11 @@ bool Actor::hitBy(Compas enemy) { else std::cout << "hit" << std::endl; if (!dodge) { character->setState(PlayerState::hurt); - animate = PlayerState::hurt; + animate = PlayerState::inMidle; + } + else { + character->setState(PlayerState::success); + animate = PlayerState::inMidle; } return dodge; }