diff options
| author | Matthew Kosarek <mattkae@protonmail.com> | 2021-05-24 13:32:27 -0400 |
|---|---|---|
| committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-05-24 13:32:27 -0400 |
| commit | c5e5d7c939a2640763775b0688ed698c51ec28c1 (patch) | |
| tree | eaa9f5493cf218471f96207d2fa86a9192f07606 /2d/_collisions/polygon_polygon/main.cpp | |
| parent | d5326e9f605e11fc33a7f37cc0ae674258de2424 (diff) | |
Applying force to the object using the mouse cursor
Diffstat (limited to '2d/_collisions/polygon_polygon/main.cpp')
| -rw-r--r-- | 2d/_collisions/polygon_polygon/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/2d/_collisions/polygon_polygon/main.cpp b/2d/_collisions/polygon_polygon/main.cpp index b928f02..1633530 100644 --- a/2d/_collisions/polygon_polygon/main.cpp +++ b/2d/_collisions/polygon_polygon/main.cpp @@ -401,12 +401,12 @@ void update(float32 deltaTimeSeconds, void* userData) { polygon->body.position.y = 0.f; polygon->body.velocity = polygon->body.velocity - Vector2 { 0.f, 1.f } * (2 * (polygon->body.velocity.dot(Vector2 { 0.f, 1.f }))); } - if (polygon->body.position.x >= 640.f) { - polygon->body.position.x = 640.f; + if (polygon->body.position.x >= 800.f) { + polygon->body.position.x = 800.f; polygon->body.velocity = polygon->body.velocity - Vector2 { -1.f, 0.f } * (2 * (polygon->body.velocity.dot(Vector2{ -1.f, 0.f }))); } - if (polygon->body.position.y >= 480.f) { - polygon->body.position.y = 480.f; + if (polygon->body.position.y >= 600.f) { + polygon->body.position.y = 600.f; polygon->body.velocity = polygon->body.velocity - Vector2 { 0.f, -1.f } * (2 * (polygon->body.velocity.dot(Vector2 { 0.f, -1.f }))) ; } } |
