diff options
| author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-10 16:26:05 +0100 | 
|---|---|---|
| committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-10 16:26:05 +0100 | 
| commit | a981a42a7378ed51155590215557e52553031272 (patch) | |
| tree | 7ca1b0cb7f72d6e8d50df09470a177a09ee12e51 /game/preview/NpcScript.cpp | |
| parent | 0f8bf257d86b5532f3d6f559e5368668c255af7c (diff) | |
missile solution, cannot find @max issue
Diffstat (limited to 'game/preview/NpcScript.cpp')
| -rw-r--r-- | game/preview/NpcScript.cpp | 9 | 
1 files changed, 2 insertions, 7 deletions
diff --git a/game/preview/NpcScript.cpp b/game/preview/NpcScript.cpp index c4148f2..5a93c2b 100644 --- a/game/preview/NpcScript.cpp +++ b/game/preview/NpcScript.cpp @@ -7,16 +7,15 @@  using namespace std;  using namespace crepe; -void NpcScript::init() {}  void NpcScript::fixed_update(duration_t dt) {  	auto & rb = this->get_component<Rigidbody>();  	auto & npc = this->get_component<Sprite>();  	auto & transform = this->get_component<Transform>(); -	if (transform.position.x < -990) { +	if (transform.position.x < 200) {  		rb.data.linear_velocity.x *= -1;  	} -	if (transform.position.x > 990) { +	if (transform.position.x > 700) {  		rb.data.linear_velocity.x *= -1;  	} @@ -25,8 +24,4 @@ void NpcScript::fixed_update(duration_t dt) {  	} else {  		npc.data.flip = {false, false};  	} - -	auto & savemgr = this->get_save_manager(); -	savemgr.set("npc_x", transform.position.x); -	savemgr.set("npc_y", transform.position.y);  }  |