Added Warrior swing sword animation
This commit is contained in:
@@ -176,10 +176,38 @@ void Player::Update(float fElapsedTime){
|
||||
}
|
||||
if(closest!=nullptr&&closest->Hurt(atk)){
|
||||
attack_cooldown_timer=ATTACK_COOLDOWN;
|
||||
swordSwingTimer=0.2;
|
||||
SetState(State::SWING_SWORD);
|
||||
switch(facingDirection){
|
||||
case DOWN:{
|
||||
UpdateAnimation(AnimationState::SWINGSWORD_S);
|
||||
}break;
|
||||
case RIGHT:{
|
||||
UpdateAnimation(AnimationState::SWINGSWORD_E);
|
||||
}break;
|
||||
case LEFT:{
|
||||
UpdateAnimation(AnimationState::SWINGSWORD_W);
|
||||
}break;
|
||||
case UP:{
|
||||
UpdateAnimation(AnimationState::SWINGSWORD_N);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float Player::GetSwordSwingTimer(){
|
||||
return swordSwingTimer;
|
||||
}
|
||||
|
||||
void Player::SetSwordSwingTimer(float val){
|
||||
swordSwingTimer=val;
|
||||
}
|
||||
|
||||
void Player::SetState(State newState){
|
||||
state=newState;
|
||||
}
|
||||
|
||||
vf2d Player::GetVelocity(){
|
||||
return vel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user