Skip to content

Add timer started usage example#766

Open
abdullah12121212 wants to merge 2 commits into
thoth-tech:mainfrom
abdullah12121212:add-timer-started-usage-example
Open

Add timer started usage example#766
abdullah12121212 wants to merge 2 commits into
thoth-tech:mainfrom
abdullah12121212:add-timer-started-usage-example

Conversation

@abdullah12121212
Copy link
Copy Markdown

@abdullah12121212 abdullah12121212 commented May 9, 2026

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.

  • New feature (non-breaking change which adds functionality)
  • Documentation (update or new)

How Has This Been Tested?

Each code file was compiled and run locally:

  • C++ — compiled with skm clang++ and run, window opened correctly
  • C# (top-level) — built and run with dotnet run, window opened correctly
  • C# (OOP) — built and run with dotnet run, window opened correctly
  • Python — run with skm python3, window opened correctly

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Firefox
  • npm run build
  • npm run preview

Checklist

Please delete options that are not relevant.

If involving code

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

If modified config files

  • I have checked the following files for changes:
    • package.json
    • astro.config.mjs
    • netlify.toml
    • docker-compose.yml
    • custom.css

Folders and Files Added/Modified

  • Added:
    • public/usage-examples/timers/timer_started-1-example.cpp
    • public/usage-examples/timers/timer_started-1-example-top-level.cs
    • public/usage-examples/timers/timer_started-1-example-oop.cs
    • public/usage-examples/timers/timer_started-1-example.py
    • public/usage-examples/timers/timer_started-1-example.txt
    • public/usage-examples/timers/timer_started-1-example.gif - [ ] folder/folder

Additional Notes

@netlify
Copy link
Copy Markdown

netlify Bot commented May 9, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit b97343c
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/6a043b8d03b99800083d69bb

@abdullah12121212 abdullah12121212 force-pushed the add-timer-started-usage-example branch from 4939792 to bd083a8 Compare May 9, 2026 14:38
Copy link
Copy Markdown

@ralphweng-autograb ralphweng-autograb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@jankiluitel jankiluitel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

abdullah12121212 and others added 2 commits May 13, 2026 18:38
- 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
Copy link
Copy Markdown

@222448082Ashen 222448082Ashen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@abdullah12121212 abdullah12121212 force-pushed the add-timer-started-usage-example branch from bd083a8 to b97343c Compare May 13, 2026 08:51
Copy link
Copy Markdown

@IssacJ1 IssacJ1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants