0 Favourites

Delta Time and Bullet Behavior

  • According to the manual. All of the behaviors except for physics already make use of Delta Time.

    Is this true as well for the bullet behavior?

    Here's an example of one of my actions:

    Every Tick:

    spr_Player.Bullet.Speed + (30 * dt)

    Or should I leave dt out of it?

    Every Tick:

    spr_Player.Bullet.Speed + 30

    Or have I got things backwards?

    Every Tick:

    (spr_Player.Bullet.Speed + 30) * dt

    Thanks!

    -Ed

  • Bullet behaviour uses delta time, I have used it a lot :) No need to do anything. I often use a gradual increase to delta time (e.g. everytick > set timescale to timescale+0.001) to have things speed up over time, and it works on bullets.

    If you want to exclude something, just set their time scale to 1 every tick too.

  • Ok, so I need to leave dt out of my events.

    However, what about rotation? Not the "Rotate Behavior"

    I'm talking about the "Rotate Clockwise" action under the "Angle" category in C2.

    Do I need to apply dt to any of those?

    Thanks for the help.

  • Then yeah, use dt. So if you want it to rotate 60 degrees per second, use 60*dt. 120 degrees, 120*dt and so on. It really is very simple once you get used to it, and really makes a big difference on slower devices!

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Ok, and you're absolutely sure I don't use dt for Bullet.speed?

    Example:

    Every Tick:

    (spr_Player.Bullet.Speed + 30) * dt

  • If you want to add or change the speed of a bullet using a calculation you can use dt, so say you want to add 1 to the bullet speed 60 times per second, you go: everytick > set bullet.speed to bullet.speed+(60*dt).

    However, if you adjust the timescale bullets will automatically move in accordance with the new timescale. So if your bullets move at 50 pixels per second, then you set timescale to 2, they will move at 100 pixels per second instead without you doing anything else.

  • Ok, thanks for the help Tobye...a ton.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[BEHAVIOR] Chipmunk Physics
673 82,508
nelostic's avatar
nelostic
Unread hot topic
0 Favourites
[Behavior] LiteTween
672 169,885
manujorgo's avatar
manujorgo
Unread hot topic
564 105,213
rexrainbow's avatar
rexrainbow