Animation V.2 :D
-
V.2 Is finally out! Please help out by telling me any bugs you find, the project is run off of delta time so you will not have any issues with FPS ruining the game.
Project: https://play.creaticode.com/projects/67c0698bfa551989442f1eae
-
@jd131111 Does it just stop after the tree area?
-
@011830-0a42ef84 Yes, for now.
-
@jd131111 said in Animation V.2:
delta time
How and what is delta time? My (newest) game is run on FPS so depending on that you could walk very slowly or just freeze altogether.
-
@the_true_odst According to the web, “Delta time is the time it took to render the frame. Another way to put it: delta time is the time period between last frame and the current. Delta means “difference”. Assuming a consistent framerate of 50, delta time will always be 1 / 50 = 0.02 seconds per frame.” Link: https://dev.to/dsaghliani/understanding-delta-time-in-games-3olf#:~:text=This is where delta time comes in. Delta,1 %2F 50 %3D 0.02 seconds per frame.
-
@mod-squadacademy and so this fixes an fps issue? Would it not be the same to just write “wait 0.02 seconds; next costume”?
-
@the_true_odst Potentially not. I personally don’t know much (yet) about Delta Time, but I do know there is a turbowarp extension (Check it out here: https://turbowarp.org/editor?extension=https://extensions.turbowarp.org/XeroName/Deltatime.js). Looking at the blocks, both the FPS and the Delta time are constantly changing.
-
@the_true_odst Delta time is basically making the game run in 30 FPS consistently, even if you go higher since it does a calculation: (num) * 30 * dt (dt would be around 0.01, based on your FPS)
dt is calculated from the last frame (timer, or you can get the day since 2000 save it into a variable and subtract it by the newer value approx.) and heres the blocks for calculating:
(sorry if they’re a bit big, I couldn’t size them down)
-
@the_true_odst Because if someone were to speed up the project using turbo mode it wouldn’t do anything, here’s an example project, the dog moves 5 per frame
https://play.creaticode.com/projects/67c9b516d2f890470312d57b