Add README

master
John Montagu, the 4th Earl of Sandvich 2026-02-22 21:57:31 -08:00
parent 7985ce395c
commit b78362bc9a
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
1 changed files with 17 additions and 0 deletions

View File

@ -33,3 +33,20 @@ run the executable with the following command:
```
# Instructions on how to use the program
Use W and S to accelerate the penguin forward and backward. Use A and D to
change heading direction. The penguin will only accelerate in the direction
facing and will retain its velocity even when not accelerating or changing
direction.
# Readme Question
`dt` is delta time, which is the time elapsed between each frame, which can be
found by taking the current time and subtracting the time from the previous
frame. Raylib provides a function `GetFrameTime()` that returns the time
elapsed since the last frame, which can be used to calculate `dt`. By using
`dt`, it ensures that physics calculations are independent of frame rate, since
otherwise the velocity would be in terms of units per frame rather than units
per second. By multiplying the velocity by `dt`, it converts the velocity to
units per second, allowing for consistent movement regardless of the frame
rate.