question about dt (when not to?)

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I understand that C2 behaviors automatically use dt

    so if I'm using a behavior to set something, say

    every tick

    set sprite1.bullet.angleofmotion to sprite2.angle

    do I use dt?

    and while I'm at it, what about something like this:

    rotate sprite1 (sprite2.car.speed/200) degrees toward (sprite2.x, sprite2.y)?

    As I'm looking at this, I'm thinking yes, but I could use a little clarification.

    EDIT: upon trying some of this out, some of it just doesn't look right.

    I think what I really need to know is when NOT to use dt?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See Delta-time and framerate independence.

    You don't need dt if you're just copying values, like setting one object's angle to another object's angle. You only need it when you increment frame-by-frame, such as moving an object to the right every frame, or rotating it a certain amount every frame. This includes rotating towards something: if you rotate 1 degree every frame, that will be 30 degrees/sec at 30 FPS and 60 degrees/sec at 60 FPS, which is framerate dependent; rotating by 60 * dt degrees will always be 60 degrees/sec at any framerate.

  • Thank you Ashley I had read that tutorial and had just gotten to where I had confused myself.

    I finally sort of understood it, and the way you just explained nails it down for me.

    Thanks!

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