Update knockback logic and formula again. Release Build 9177.
This commit is contained in:
parent
8f02afb7bb
commit
ef53d9852a
@ -838,7 +838,11 @@ geom2d::circle<float>Monster::Hitbox(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Monster::Knockback(const vf2d&vel){
|
void Monster::Knockback(const vf2d&vel){
|
||||||
|
//A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied.
|
||||||
|
float maxVelThreshold=std::max(vel.mag(),this->vel.mag());
|
||||||
this->vel+=vel;
|
this->vel+=vel;
|
||||||
|
float newVelAngle=this->vel.polar().y;
|
||||||
|
this->vel=vf2d{maxVelThreshold,newVelAngle}.cart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Monster::Knockup(float duration){
|
void Monster::Knockup(float duration){
|
||||||
|
@ -305,9 +305,11 @@ State::State Player::GetState(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Player::Knockback(vf2d vel){
|
void Player::Knockback(vf2d vel){
|
||||||
if(!HasIframes()){
|
//A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied.
|
||||||
this->vel+=vel;
|
float maxVelThreshold=std::max(vel.mag(),this->vel.mag());
|
||||||
}
|
this->vel+=vel;
|
||||||
|
float newVelAngle=this->vel.polar().y;
|
||||||
|
this->vel=vf2d{maxVelThreshold,newVelAngle}.cart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Update(float fElapsedTime){
|
void Player::Update(float fElapsedTime){
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 9176
|
#define VERSION_BUILD 9177
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user