Add timer started usage example#766
Conversation
❌ Deploy Preview for splashkit failed.
|
4939792 to
bd083a8
Compare
ralphweng-autograb
left a comment
There was a problem hiding this comment.
Solid timer_started example, the Start/Stop UX is clear and the C++/C#/Python all line up. The "// SplashKitSDK.Timer needed to distinguish from System.Threading.Timer" comment is a nice why-not-what touch.
One thing to sort out before this can merge though: this PR has the move_mouse_to_point files in it as well as timer_started, and it looks like move_mouse_to_point is already its own PR (#765). The title here says only "timer started" so I'm guessing the move_mouse files got bundled in by accident. Best to either close #765 or drop the move_mouse_to_point files from this PR, one example per PR.
One small thing on the timer_started side: the window title is "Timer Started", but your .txt has the perfect descriptive name "Start-Stop Stopwatch". Could use that for the window too, reads better than the function name.
Once the move_mouse files are out should be good.
jankiluitel
left a comment
There was a problem hiding this comment.
I checked the integration of the move_mouse_to_point examples included in this PR, and both additions maintain good formatting and educational value. Everything looks clean on my end and is ready for merge after final checks pass. The new timer_started usage example PR is well-structured across all supported languages, and the GIF/demo clearly demonstrates the timer start-stop functionality. The comments and naming are consistent with existing SplashKit usage examples, and the implementation is easy to follow for beginners. The GIF/demo clearly illustrates the timer start-stop feature, and the examples are organised in all available languages. The implementation is simple for novices to understand, and the comments and nomenclature are in line with current SplashKit usage examples.
Additionally, I examined the integration of the move_mouse_to_point examples that are part of this PR, and both additions retain excellent formatting and instructional value. From my perspective, everything appears to be in order and is prepared for merging once the last checks are completed.
I have given my approval. The usage examples for timer_started and move_mouse_to_point are implemented consistently across all supported languages, with clear comments, a clean structure, and helpful demo assets. They are easy to use for beginners and conform well to the current SplashKit documentation standards. Excellent work. All supported languages utilise the same implementation of the timer_started and move_mouse_to_point use examples, which have clear comments, a tidy structure, and helpful sample assets. The examples fit very nicely with the current SplashKit documentation standards and are suitable for beginners. Fantastic work.
- Rebased out the move_mouse_to_point commit (those files belong to PR thoth-tech#765) - Changed window title from 'Timer Started' to 'Start-Stop Stopwatch' to match the descriptive name in the .txt file, as suggested by reviewer
222448082Ashen
left a comment
There was a problem hiding this comment.
Peer Review
I've reviewed the timer_started usage example.
Checks
- All required files are present.
- Example Title (.txt): timer_started-1-example.txt
- C++ code timer_started-1-example.cpp
- C# code (top-level statements) timer_started-1-example-top-level.cs
- C# code (Object-Oriented Programming) timer_started-1-example-oop.cs
- Python code: timer_started-1-example.py
- Code correctly uses SplashKit functions (verified against API documentation).
- Code clearly demonstrates the function with interactive timer control.
- All versions maintain the same structure and comments.
Code Tests done
- C++ code: Syntax verified (uses correct timer_started(timer) and timer_ticks() functions)
- C# top level code: Syntax verified (uses correct TimerStarted(Timer) and TimerTicks() methods)
- C# OOP code: Syntax verified (uses correct TimerStarted(Timer) and TimerTicks() with proper namespacing)
- Python code Syntax verified (uses correct timer_started() and timer_ticks() functions)
Website Tests done
- npm run build
- npm run preview
- All example files properly structured
bd083a8 to
b97343c
Compare
There was a problem hiding this comment.
The timer_started feature is working well. All the required files are included, and the SPACE/S key controls are easy to understand and use. The GIF also clearly shows how the interaction works.
I have also fixed the previous feedback by focusing only on timer_started, and I updated the window title to “Start-Stop Stopwatch”.
One small thing is that the C# OOP code indentation could be made more consistent with the other examples, but overall everything looks good.
Description
Adds a usage example for the timer_started function from the SplashKit Timers API. The example is a simple start/stop stopwatch that demonstrates how to create a timer, start and stop it with keypresses, and use timer_started to check whether it is currently running. The elapsed time is displayed in milliseconds on screen.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Each code file was compiled and run locally:
Testing Checklist
Checklist
Please delete options that are not relevant.
If involving code
If modified config files
Folders and Files Added/Modified
Additional Notes