Add calculate_collision_direction usage example - #800
Conversation
❌ Deploy Preview for splashkit failed.
|
ralphweng2023
left a comment
There was a problem hiding this comment.
Nice example, driving the moving circle with the arrow keys makes the direction vector easy to actually see rather than just read about. The C++ and both C# versions look right to me, CalculateCollisionDirection and CircleAt are genuine overloads in those two languages so the calls resolve.
Python is the problem. It doesn't overload, every type combination gets its own name, and two calls in the .py don't exist as written. circle_at takes a point and a radius, the three argument form is circle_at_from_points. There is no bare calculate_collision_direction in the Python binding either, the circle to circle one is calculate_collision_direction_between_circles. So the .py raises before it draws anything, which also means the gif can't have come from that version. Please switch both names over.
|
Thanks @ralphweng2023. I updated the Python version to use circle_at_from_points and calculate_collision_direction_between_circles, and verified it runs correctly. |
ralphweng2023
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. 80f1084 renames all three calls, circle_at_from_points for both circles and calculate_collision_direction_between_circles for the collision check, which is the right mapping for the way the Python binding splits those overloads out. The C++ and both C# versions were already correct and are untouched by the fix. Approved.
Nadiazahan
left a comment
There was a problem hiding this comment.
Nice work on this usage example. The different language versions are consistent and clearly show how calculate_collision_direction works between two circles. The arrow key movement also makes the example easy to understand and test. The Python changes look fixed now, and the GIF and description are included as required. Everything looks good to me. Approved.
Description
Splashkit Function:
calculate_collision_directionOverview of example functionality: This example demonstrates how
calculate_collision_direction_between_circlescalculates the direction between two overlapping circles. The user can move the blue circle using the Arrow Keys. When the circles collide, a yellow line shows the calculated collision direction and the on-screen status changes to indicate that a collision has been detected.Example Output:

Files Included
Usage Example Checks (READ CAREFULLY)