Microsoft MakeCode

Timers extension: after X, debounce, throttle, and in-background

Hello world,

I create a new “Timers” extension: https://github.com/darzu/arcade-timers
Early beta.

Sample: https://makecode.com/_c57bYTea0RFV

Blocks

Examples

“After X do” / aka setTimeout:

“Separately do” / aka run in background thread:

“after Y settled for X do” / aka debounce:

“for Y at most once every X do” / aka throttle:

4 Likes

Oooh. These look nice! I’m curious if there are many implementation differences between your setTimeout equivalent and @peli’s recently posted setTimeout-sounding block:

My APIs are integrated into the arcade runtime, eg they will run at the same priority as the “on game update” handler.

Ah. I should probably learn more about this.

Is this documentation still mostly relevant? https://arcade.makecode.com/developer/game-loop … the version number mentioned in the beginning looks to be a bit behind the current release.

Yes it’s pretty good. This part has not changed much.

1 Like