Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made custom-fps.md clearer #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/website/settings/custom-fps.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ hide_table_of_contents: true

# 60 FPS (Custom FPS)

Custom FPS (frames per second) changes how often scripts are run every second. Most often this is changed to 60 FPS, but any value between 1 and 250 is possible.
A custom FPS (frames per second) changes how often scripts are run every second. Most often this is changed to 60 FPS, but any value between 1 and 250 is possible.

A value of 0 is special: It will make the project run at the same framerate as the screen instead of a set interval. This also means that the project's scripts may stop running when the project's tab is hidden.
A value of 0 will make the project run at the same framerate as the screen instead of a set interval. This also means that the project's scripts may stop running when the project's tab is hidden.

A vast majority of projects will not work properly with custom framerates. For these projects, [interpolation](interpolation) should be used instead. For example, consider the following simple script:

![When flag clicked, forever move 1 step](./forever-move-1-step.svg)

When running at 30 FPS (as Scratch typically does), this script will run 30 times per second so the sprite will move 30 steps per second. However, if the framerate is changed to 60, the script will run 60 times per second so the sprite will move twice as many steps in a second.
When running at 30 FPS (as Scratch typically does), this script will run 30 times per second, so the sprite will move 30 steps per second. However, if the framerate is changed to 60, the script will run 60 times per second, so the sprite will move twice as many steps in a second.

To make projects that are compatible with custom framerates, you should use techniques such as delta time:

- https://en.wikipedia.org/wiki/Delta_timing
- https://scratch.mit.edu/projects/487694716/ (Scratch example)

These techniques may require significant changes to your project.
Please note that using these techniques may require significant changes to your project.