# Mini Golf Game: Stage 1 - Canvas Setup Quiz ## Check Your Understanding **Name: _________________________ Date: _____________ Score: _____ / 100** --- ### Question 1 (10 Points) **What is a canvas on a web page?** A) A photo of a painting from an art gallery B) A programming language used to make graphics C) A data storage container for storing images and multimedia files D) A space where graphics can be displayed and interacted with by users **Your Answer: _____** --- ### Question 2 (10 Points) **Which of the following is the correct code to create a p5play canvas that is 400 pixels wide and 300 pixels tall?** A) `new Canvas(400, 300);` B) `new Canvas(300, 400);` C) `new.Canvas(400, 300);` D) `Canvas.new(300, 400);` **Your Answer: _____** --- ### Question 3 (10 Points) **[Location diagram question - refer to your textbook or class materials]** A) Location A B) Location B C) Location C D) Location D **Your Answer: _____** --- ### Question 4 (10 Points) **What does the following code do?** ``` clear(); background('red'); ``` A) It clears a web page and sets the background to red. B) It makes the border of the canvas clear and then sets its background to red. C) It clears all graphics from the canvas and then sets its background to red. D) It clears the values stored in the variables and then sets the canvas background to red. **Your Answer: _____** --- ### Question 5 (10 Points) **Which statement best explains the purpose of the setup() and draw() functions when using p5play?** A) They are both used to draw graphics only once at the beginning of the program. B) The setup() function runs once at the start to prepare the program, while draw() runs continuously to update visuals. C) The setup() function handles math calculations, and draw() controls keyboard input. D) The draw() function only runs when a key is pressed, and setup() restarts the program loop. **Your Answer: _____** --- ### Question 6 (10 Points) **Where is the origin of the canvas located?** A) Top left B) Top right C) Center D) Bottom left E) Bottom right **Your Answer: _____** --- ### Question 7 (10 Points) **The x-coordinate increases as you move in which direction?** A) Up B) Down C) Left D) Right **Your Answer: _____** --- ### Question 8 (10 Points) **The y-coordinate increases as you move in which direction?** A) Up B) Down C) Left D) Right **Your Answer: _____** --- ### Question 9 (10 Points) **What will happen if you put `new Canvas(450, 520);` inside the draw() function instead of setup()?** A) The canvas will be created once at the start of the game. B) The canvas will be recreated every frame, clearing everything drawn before. C) The canvas will not appear at all. D) The program will crash immediately. **Your Answer: _____** --- ### Question 10 (10 Points) **Why is it important to include clear(); at the start of your draw() function?** A) It deletes your canvas permanently. B) It removes the old frame so that objects don't leave trails. C) It clears the mouse coordinates from the screen. D) It refreshes the computer's memory. **Your Answer: _____** --- ## Answer Sheet Use this space to write your answers clearly: 1. _____ 2. _____ 3. _____ 4. _____ 5. _____ 6. _____ 7. _____ 8. _____ 9. _____ 10. _____
|
|