O'Reilly logo

Learn JavaScript with p5.js: Coding for Visual Learners by Engin Arslan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Engin Arslan 2018
Engin ArslanLearn JavaScript with p5.jshttps://doi.org/10.1007/978-1-4842-3426-6_5

5. Conditional Statements and Comparison Operators

Engin Arslan
(1)
Toronto, Ontario, Canada
 
In the previous chapter, we saw some of the variables that p5.js makes available for us. One important thing to note is that these variables can only be used from inside the p5.js functions setup and draw. If we were to try to use them outside these functions, we would get an error saying that they are not declared.
In this chapter we’ll look at another useful variable that p5.js makes available for us: frameCount. We will also learn about frames and frameRate function.

frameCount, frameRate, and frame

Remember how we defined a count function in the previous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required