P5JS Functions

12345678910111213141516171819202122232425
Across
  1. 2. What does this p5.js code do? Describe what will be displayed on the screen.
  2. 5. What function changes the alignment of text in p5.js?
  3. 6. What is the built-in variable that stores the vertical position of the mouse?
  4. 8. What p5.js function changes the way rectangle positions are defined?
  5. 10. What function checks if a key is pressed in p5.js?
  6. 14. What is the purpose of the setup() function in p5.js?
  7. 15. What is the difference between the setup() and draw() functions in p5.js?
  8. 17. What built-in variable stores the key code when a key is pressed?
  9. 20. What function disables the stroke of shapes in p5.js?
  10. 22. Write a line of p5.js code that draws a circle with a diameter of 50 pixels at (200, 150).
  11. 23. What function stops the draw loop in p5.js?
  12. 25. What is the built-in variable that stores the horizontal position of the mouse?
Down
  1. 1. What does background(255, 0, 0); do in p5.js?
  2. 3. What function sets the color of the shape’s outline in p5.js?
  3. 4. What function draws a line between two points in p5.js?
  4. 7. What function sets the number of frames per second in p5.js?
  5. 9. What is the function used to draw an ellipse in p5.js?
  6. 11. What will happen if you write fill(0, 255, 0); ellipse(100, 100, 50, 50); in the draw() function?
  7. 12. What built-in variable stores the actual key value when a key is pressed?
  8. 13. What function changes the font size for text in p5.js?
  9. 16. Which of the following correctly creates a canvas of width 400 and height 300 in p5.js?
  10. 18. What function is used to create the drawing area in p5.js?
  11. 19. What function is used to disable filling shapes in p5.js?
  12. 21. The following code has a mistake. What is wrong with it? How would you fix it?
  13. 24. What function generates a random number in p5.js?