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/PrevPlayerSubScene.cpp | |
parent | b9d00961a8894356c7cff7597de424a12d2841a6 (diff) | |
parent | 16917357837916d1ef88b6122218fa0d567d1ddc (diff) |
Merge pull request #131 from lonkaars/niels/game
Niels/game
Diffstat (limited to 'game/preview/PrevPlayerSubScene.cpp')
-rw-r--r-- | game/preview/PrevPlayerSubScene.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/game/preview/PrevPlayerSubScene.cpp b/game/preview/PrevPlayerSubScene.cpp index b59a0af..9ff111c 100644 --- a/game/preview/PrevPlayerSubScene.cpp +++ b/game/preview/PrevPlayerSubScene.cpp @@ -16,13 +16,8 @@ using namespace crepe; PrevPlayerSubScene::PrevPlayerSubScene(Scene & scn) { - auto & savemgr = scn.get_save_manager(); - ValueBroker player_x = savemgr.get<float>("player_x", 500); - ValueBroker player_y = savemgr.get<float>("player_y", -100); - - GameObject player - = scn.new_object("player", "TAG", vec2 {player_x.get(), player_y.get()}, 0, 1); + GameObject player = scn.new_object("player", "player", vec2 {800, -100}, 0, 1); Asset player_body_asset {"asset/barry/defaultBody.png"}; Sprite & player_body_sprite = player.add_component<Sprite>( player_body_asset, @@ -75,10 +70,10 @@ PrevPlayerSubScene::PrevPlayerSubScene(Scene & scn) { } ); player.add_component<Rigidbody>(Rigidbody::Data { - .gravity_scale = 20, + .gravity_scale = 1, .body_type = Rigidbody::BodyType::DYNAMIC, .linear_velocity = vec2(100, 0), - .collision_layers = {COLL_LAY_BOT_TOP}, + .collision_layers = {COLL_LAY_BOT_TOP, 100}, .collision_layer = COLL_LAY_PLAYER, }); player.add_component<BoxCollider>(vec2(50, 50)); |