You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't sure about the note in margin on page 43. Having just tried it, I'm now confused myself. In some sketches I can call createVector() outside of setup() and in others, like the one below, it has to be in setup(). I thought it might have to do with declaring the associated global variables of position and velocity at top of file, but that doesn't seem to change anything.
In the end, from a reader's standpoint - my preference would be for just taking out one or the other references to it (personally I like it in margin of example where it can't be glossed over.)
Page 40, first paragraph ("can't" bold mine)
...I should note that p5.js functions such as createVector()can't be executed outside of setup() or draw()...
Page 43, Example 1.2 (around line 6 -- in margin note)
Note that createVector()has to be called inside setup.
The text was updated successfully, but these errors were encountered:
Ah, thanks for this comment! I agree this is confusing! I have to think about how to best address it. createVector() can actually be called anywhere in the code! As long as that code is not being executed beforesetup() when p5.js is guaranteed to have been loaded.
I wasn't sure about the note in margin on page 43. Having just tried it, I'm now confused myself. In some sketches I can call
createVector()
outside ofsetup()
and in others, like the one below, it has to be insetup()
. I thought it might have to do with declaring the associated global variables ofposition
andvelocity
at top of file, but that doesn't seem to change anything.In the end, from a reader's standpoint - my preference would be for just taking out one or the other references to it (personally I like it in margin of example where it can't be glossed over.)
Page 40, first paragraph ("can't" bold mine)
Page 43, Example 1.2 (around line 6 -- in margin note)
The text was updated successfully, but these errors were encountered: