godot_recipes
godot_recipes copied to clipboard
[Discussion] Basics: Understanding 'delta'
Discussion for http://godotrecipes.com/basics/understanding_delta/
Hi cbscribe.
How is 0.033 computed?
Code snippet
`Acceleration in pixels/sec/sec. var gravity = Vector2(0, 120)
Acceleration in pixels/frame/frame. var gravity_frame = Vector2(0, .033) `
Thank you.
How is 0.033 computed?
Because this example is using 120 pix/sec/sec
for gravity, the per-frame acceleration is going to be 120 * (1/60) * (1/60) = 0.033
. This is so that you can see the difference by setting use_delta
and changing the FPS.
How were you able to display an fps counter and a toggle for delta?
How were you able to display an fps counter and a toggle for delta?
A SpinBox node and a CheckButton node.