Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Creating a Mini-Game with Crucial 3-Second Rounds  (Read 354 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Creating a Mini-Game with Crucial 3-Second Rounds
« on: September 13, 2023, 09:54:05 pm »

I'm currently collaborating with a brain science lab on a simple experiment. In each round of the game, the player's tasks are as follows:

1) Initially, a cross is displayed.

2) Then, a red circle appears in the center.

3) The player must click on the central circle.

4) Subsequently, they must patiently wait for a green target to appear.

5) Once the green target appears, the player's objective is to touch it (no clicking is involved). It's essential to note that the target may change its position while the player is attempting to touch it.

I've successfully developed the game. However, there's a challenge:

Each round (from cross to cross) should take exactly 3 seconds, but it currently takes slightly longer, around 3.03 seconds. Do you have any ideas on how to ensure that each round will take precisely 3 seconds?

I'm using Windows 11, SFML 2.6, with the following hardware:

GPU: RTX 2060
CPU: i7


  • SFML Team
  • Hero Member
  • *****
  • Posts: 10936
    • View Profile
    • development blog
    • Email
Re: Creating a Mini-Game with Crucial 3-Second Rounds
« Reply #1 on: September 14, 2023, 02:05:30 pm »
How are you measuring the time?

Do you use Vsync or setFrameratLimit?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
Dev Blog: https://duerrenberger.dev/blog/