Add vector_from_angle usage example - #796
Conversation
❌ Deploy Preview for splashkit failed.
|
Rhinoatron
left a comment
There was a problem hiding this comment.
Great work on this task. The interactive rotating vector is a clear visual demonstration of vector_from_angle, and the on screen angle and instructions make the example easy to understand, all required files are also included. I’d like to request a change to the C# top-level version. It currently mixes OOP-style code with top level conventions by creating the window with new Window, using window.CloseRequested, accessing colours through Color, and constructing points with new(). Could you please update it to use the expected top-level SplashKit functions, such as OpenWindow, QuitRequested, ColorBlack(), and PointAt where appropriate? Please also close the window after the loop and keep the visual colours and instruction text consistent across all four versions. This will make the top level example clearer for beginners and more consistent with the other language implementations we have. Once that’s updated, I can review it again. 🙂
|
Hi @Rhinoatron, I’ve updated the C# top-level version to use the expected top-level SplashKit conventions. ready for another review. |
Rhinoatron
left a comment
There was a problem hiding this comment.
Thanks for making the requested changes, I can now see the C# top level version follows the expected SplashKit conventions, and the example clearly demonstrates vector_from_angle across all four languages. One optional consistency note: the vector colour, instruction colour, and instruction wording differ slightly between versions it would be good to align these later, but they don’t affect the functionality or clarity of the example. Approved.
ralphweng2023
left a comment
There was a problem hiding this comment.
The requested changes are in 7f78466. The top level version now opens with using static SplashKitSDK.SplashKit and calls OpenWindow and QuitRequested directly instead of going through a Window object.
Worth pointing out the angle display, since that is where these usually drift apart. The C++ casts to int before std::to_string and the other three use a format specifier, so all four print -40 the way the gif shows it. Approved.
Description
Splashkit Function:
vector_from_angleOverview of example functionality: This example demonstrates how to create a vector from an angle and length using
vector_from_angle. The user can rotate the vector with the Left and Right Arrow keys while the current angle is displayed on the screen.Example Output:

Files Included
Usage Example Checks (READ CAREFULLY)