diff options
author | heavydemon21 <48092678+heavydemon21@users.noreply.github.com> | 2025-01-10 20:08:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 20:08:37 +0100 |
commit | ba0db2e49ff1b5c3e952c00bbc3f31176397f6b6 (patch) | |
tree | eefa561b81c48549277950692fdad714a2f501f2 /game/preview/NpcScript.cpp | |
parent | b9d00961a8894356c7cff7597de424a12d2841a6 (diff) | |
parent | 16917357837916d1ef88b6122218fa0d567d1ddc (diff) |
Merge pull request #131 from lonkaars/niels/game
Niels/game
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); } |