feat: added delay to detecting the player
This commit is contained in:
parent
f646f70c37
commit
6456d81794
2 changed files with 6 additions and 3 deletions
|
|
@ -46,7 +46,8 @@ void PlayerDetector::process(double delta) {
|
|||
} else {
|
||||
this->query_timer = this->query_time;
|
||||
bool const new_awareness{ check() };
|
||||
if (new_awareness != this->aware_of_player) {
|
||||
this->awareness = CLAMP(this->awareness + (new_awareness ? this->awareness_increments : -this->awareness_increments), 0.0, 1.0);
|
||||
if (this->awareness >= 1.0) {
|
||||
set_aware_of_player(new_awareness);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue