Extension for Adding Delta Time to Blocks

I’ve made an extension which allows Delta Time to be in blocks! This is a useful extension because you can take the delta block and multiply something a value by it, and if your project has a low framerate, or if you just want it to work well on hardware/mobile devices, objects will move at normal speeds instead of slow motion.

Here’s the extension: https://github.com/kiwiphoenix364/pxt-deltatime
Paste this into the search bar of the extensions page on the editor and click the extension that comes up. Then your block should be added. Also, @UnsignedArduino, it’s your choice whether you want to or not, but you could add it to your “Awesome Arcade Extensions” Github page.

1 Like

Could you give an example on how to use this? Little confused on what the delta block actually represents. Milliseconds since last frame?

1 Like

If the gap between frames is larger than normal, it will output a higher value, equivelant to if the dropped frames were there. If you set a speed or acceleration (you have to set it every frame so it detects what the delta variable is every frame) to " * delta", then if frames are dropped, the delta time variable will account for that.

1 Like

I tried to make an example, but it doesn’t seem to work lol

Could you help me fix it? I’ll add it to the list once I get an example for this.

Sorry, I didn’t have the math right… I got it right now, and you can see very well here how it works:

You can change how laggy it is with the up and down arrows. The bottom one moves the same speed, no matter the framerate. You can also use the top one for reference, as it does not have delta applied to it. The multiplier level is below, the number of times the top one has gone across the screen is in the life counter, and the score counter shows how many times the bottom one has gone across the screen. Sorry I had the extension messed up before…

1 Like

I’ve made a new demo (no updates to the extension, I’ve just made the demo more “usable”)

1 Like