How do I move an object 1 pixel to the right every tick using DT?

0 favourites
  • 2 posts
From the Asset Store
Vintage steam pixels for your UI! 125 unique assets in a single pack!
  • Hi there everyone, thank you so much for taking a look at this post. I'm finally getting my head around delta time and need somebodies expert guidance to help me understand.

    So, I'm looking to move an object 1 pixel to the right every tick - easy when using the every tick command. However, running this on a fast hz monitor makes the object way too fast.

    So how can I re-phrase this using DT? I'd like to a michael scott gif of explain like I'm five, but you get the gist ;)

    Thank you so much!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • dt is the measure of time (in seconds) that elapsed since the last tick.

    Let's say you add dt to the x position of a sprite each tick, it will effectively move one pixel to the right every second.

    If you want to "mimick" an "every tick" synced at 60fps, you could then add dt*60 to the position, so the sprite would move 60 pixels to the right every second, independently of the current refresh rate.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)