Minor fixes
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 16s

This commit is contained in:
Stephen Seo 2023-08-15 14:56:58 +09:00
parent e1c82e0354
commit 761c5c462c

View file

@ -4,6 +4,7 @@
#include <cmath>
// third party includes
#include <raylib.h>
#include <raymath.h>
// local includes
@ -160,6 +161,9 @@ void Walker::set_player_controlled(bool player_controlled) {
flags &= ~0x3B;
flags |= 8;
target_body_pos = body_pos;
roaming_timer = 0.0F;
roaming_time =
call_js_get_random() * ROAMING_WAIT_VARIANCE + ROAMING_WAIT_AMOUNT;
} else {
flags &= ~0x38;
}
@ -184,11 +188,11 @@ void Walker::player_go_forward() { flags |= 0x30; }
BoundingBox Walker::get_body_bb() const {
return BoundingBox{
.min = body_pos - Vector3{0.5F,
0.5F + BODY_IDLE_MOVE_AMOUNT *
-BODY_IDLE_MOVE_AMOUNT *
std::sin(body_idle_move_timer + PI),
0.5F},
.max = body_pos + Vector3{0.5F,
0.5F + BODY_IDLE_MOVE_AMOUNT *
1.0F + BODY_IDLE_MOVE_AMOUNT *
std::sin(body_idle_move_timer + PI),
0.5F}};
}