diff options
author | jaroWMR <jarorutjes07@gmail.com> | 2024-11-07 18:39:56 +0100 |
---|---|---|
committer | jaroWMR <jarorutjes07@gmail.com> | 2024-11-07 18:39:56 +0100 |
commit | e2f3ace383b43cc3f140629e577b97c6f69c9856 (patch) | |
tree | 690eb146e11a4bc134840ec82bfbea4805daba61 /src/example/ecs.cpp | |
parent | 156906dca0b84d3fd3c889e1bcda12308b8fe793 (diff) |
added physics system
Diffstat (limited to 'src/example/ecs.cpp')
-rw-r--r-- | src/example/ecs.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/example/ecs.cpp b/src/example/ecs.cpp index 0c64373..e61c398 100644 --- a/src/example/ecs.cpp +++ b/src/example/ecs.cpp @@ -11,11 +11,11 @@ using namespace std; int main() { // Create a few GameObjects try { - GameObject body(0, "body", "person", Point{0, 0}, 0, 1); - GameObject right_leg(1, "rightLeg", "person", Point{1, 1}, 0, 1); - GameObject left_leg(2, "leftLeg", "person", Point{1, 1}, 0, 1); - GameObject right_foot(3, "rightFoot", "person", Point{2, 2}, 0, 1); - GameObject left_foot(4, "leftFoot", "person", Point{2, 2}, 0, 1); + GameObject body(0, "body", "person", Vector2{0, 0}, 0, 1); + GameObject right_leg(1, "rightLeg", "person", Vector2{1, 1}, 0, 1); + GameObject left_leg(2, "leftLeg", "person", Vector2{1, 1}, 0, 1); + GameObject right_foot(3, "rightFoot", "person", Vector2{2, 2}, 0, 1); + GameObject left_foot(4, "leftFoot", "person", Vector2{2, 2}, 0, 1); // Set the parent of each GameObject right_foot.set_parent(right_leg); @@ -24,7 +24,7 @@ int main() { left_leg.set_parent(body); // Adding a second Transform component is not allowed and will invoke an exception - body.add_component<Transform>(Point{10, 10}, 0, 1); + body.add_component<Transform>(Vector2{10, 10}, 0, 1); } catch (const exception & e) { cerr << e.what() << endl; } |