Discuss Scratch

-Zyntronic-
Scratcher
72 posts

Please let 'deltaTime' be a feature.

I would really like it if Scratch added something called ‘deltaTime’. It's extremely used in C# and very useful. What it does is that no matter what framerate or slow your device is, whatever loop you multiply it by, it will stay constant which is great for anti-jittery code. This request isn't too bizzare so i hope this makes the cut. For more information on how it works, go to YouTube and see the uses of Time.deltaTime…

Follow me, I make pixel art games and realistic simulations for everyone to enjoy!

-Valtren-
Scratcher
1000+ posts

Please let 'deltaTime' be a feature.

I think what you're trying to say is make scratch run the same regardless of framerate
semi support, while I would like to play chirpy reverie in 250 fps existing FPSI projects will no longer be special
now for actual delta time there are workarounds but they're hard and the only things on scratch to have a 100% guarantee that they will not work outside of their example projects



Famous quotes:

Za-Chary wrote:

Steve Carell as Scratch Cat yo what the heck bro src

-Rodri wrote:

106809nes wrote:

This is the second-best suggestion I've seen.
Why is it the second-best suggestion I've seen? Well, view this topic to find out!
what in the capitalism, you really had to sneak in an ad lol src

The_Game_ wrote:

From my careful predictions that I have been calculating for 3 whole years, spent thousands of dollars on and have stayed up at night doing; it'll have 1 billion projects. src

wolvesstar97 wrote:

TAGS MUST GO!
THERE IS A SOLUTION: Narwhals! src

WallydogChoppychop wrote:

Scratch cat looked like a mouse src

Za-Chary wrote:

among_us1w2 wrote:

no like in darkrp if you have been warn for failbase class 1 you get warning but if you do failbase class 3 you get warning but next time you break rules you get 5 min jail
This is the greatest slang of All Time. src


More quotes here.
IndexErrorException
Scratcher
500+ posts

Please let 'deltaTime' be a feature.

You can do this already by making a main loop where you do all the stuff you want per frame than puting a reset timer block at the top and setting a deltaTime variable to the timer. This way the timer will always be the frameTime which than you can do FPS = 1 / frameTime. I do this alot so when I use turbowarp at 240 fps I don't zoom around.

See https://scratch.mit.edu/projects/650823521/ go to the laser sprite and look at the forever loop. I multiply a constant by the dt(deltaTime) and that means no matter my frame rate, it will always change by the constant every second.

Last edited by IndexErrorException (Aug. 6, 2022 16:17:52)

pythonicKI
Scratcher
100+ posts

Please let 'deltaTime' be a feature.

to get deltatime for projects with no “move” blocks etc (blocks that run and take up time), you basically have to use calculus (the deltatime might even be random idk)

like this:

forever
change [myvar v] by (1)
end

delta time is like 0.00001 or something like that. You can't use timer since it's not that accurate and just gives you 0.

the feature would be very nice :)

Scratcher since 2020

forumer, scratcher, programmer
highlight+ctrl+shift+down to see the rest of my siggy

Trek to 1000 Posts:
408/1000 posts | 40.8% | 162 days on scratch | at this rate, it will take me 237 more days to reach 1000.

however, I've recently been a lot more active on the forums, and I estimate that I'll get to 1000 in two weeks ;)


I'm active on:
  • Help with Scripts
  • Questions about Scratch
  • Suggestions

I make cool, polished projects :D


250th post (Show & Tell):
https://scratch.mit.edu/discuss/posts/7823802

100th post (Project Save & Level Codes):
https://scratch.mit.edu/discuss/posts/7761802

Fiftieth post (Help with Scripts):
https://scratch.mit.edu/discuss/post/7754776

Twenty-fifth post (Help with Scripts):
https://scratch.mit.edu/discuss/7752757

First post (Project Save & Level Codes):
https://scratch.mit.edu/discuss/post/7535938/


Help with Scripts Februrary 26, 2024:


I posted 100+ times today - I don't think I ever want to do that again.

End of siggy.

Powered by DjangoBB