Skip to content

Commit a8fe721

Browse files
committed
fix: Case of frameCount in URL
1 parent 4d9d97d commit a8fe721

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/tutorials/en/variables-and-change.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,13 @@ In this step, you:
747747
- added a tree made of a rectangle (tree trunk) and a triangle (leaves);
748748
- modified the value for the y-coordinate of the top corner of the triangle (`y2`) by subtracting it by `frameCount % 290` (see [triangle()](/reference/p5/triangle) Diagram for a reminder of `y2`):
749749
- Since you want the tree leaves to grow, the top corner of the triangle needs to move up on the canvas each time [`draw()`](/reference/p5/draw) runs. As seen in [this example](https://editor.p5js.org/p5Master718/sketches/605MEWNxh), the y-coordinate (`y2`) of the point that moves up on the canvas decreases. 
750-
- To achieve this motion, you modified the value for `y2` by subtracting `240 - frameCount % 290`. This decreases `y2` by the remainder when [`frameCount`](/reference/p5/framecount) is divided by 290. 
750+
- To achieve this motion, you modified the value for `y2` by subtracting `240 - frameCount % 290`. This decreases `y2` by the remainder when [`frameCount`](/reference/p5/frameCount) is divided by 290. 
751751
- As you saw in [Step 5](#step-5), each time the [`draw()`](/reference/p5/draw) function runs, the value returned by `frameCount % 290` increases by `1` so that `y2` also changes.
752752
- Before [`draw()`](/reference/p5/draw) runs, `y2` is `240`.
753753
- The first time [`draw()`](/reference/p5/draw) runs, the value from `frameCount % 290` is `1`, and `y2` becomes `239`.
754754
- The second time [`draw()`](/reference/p5/draw) runs, the value from `frameCount % 290` is `2`, and `y2` becomes `238`.
755755
- The third time [`draw()`](/reference/p5/draw) runs, the value in `frameCount % 290` is `3`, and `y2` becomes `237`.
756-
- Once [`frameCount`](/reference/p5/framecount) becomes a number that is a multiple of `290`, the value in `frameCount % 290` is `0`, and `y2` is set back to its original value of `240`.
756+
- Once [`frameCount`](/reference/p5/frameCount) becomes a number that is a multiple of `290`, the value in `frameCount % 290` is `0`, and `y2` is set back to its original value of `240`.
757757
- This pattern continues until [`draw()`](/reference/p5/draw) is stopped.
758758

759759
Visit the following p5.js reference pages for more information: [`frameRate()`](/reference/p5/frameRate) | [`frameCount`](/reference/p5/frameCount) | [`triangle()`](/reference/p5/triangle)

0 commit comments

Comments
 (0)