Question 1 (5 points): Purpose: Practice using the mouse handler to interact with the canvas. Degree of Diculty: Easy Bert and Ernie are good friends who just got their pictures taken, and now they...

Question 1 (5 points): Purpose: Practice using the mouse handler to interact with the canvas. Degree of Diculty: Easy Bert and Ernie are good friends who just got their pictures taken, and now they want to see them. Your job is to write a Processing program that will allow the user to ip back and forth between the picture of Bert and the picture of Ernie. When your program starts, it should display a picture of Bert’s face. Whenever the user clicks the mouse, it should display Ernie’s face (if Ernie’s face was already displayed, well then it should keep displaying Ernie’s face). Whenever the user presses any key, it should display Bert’s face (again, regardless of whether Bert’s face was already being displayed). In this way, the user can toggle back and forth between the pictures of Bert and Ernie as many times as they like. Your pictures of Bert and Ernie need not look exactly like the sample, but you should make a reasonable attempt at aesthetic appeal. We are aware their hair doesn’t look great. Hair is hard! Hint: You may nd the strokeWeight() function useful to draws lines of dierent thickness. Figure 1: Picture of Bert (left) and Ernie (right) What To Hand In: Your code in a le named a3q1.pyde. Evaluation: • 0 marks for submitting nothing and/or les that cannot be opened. • -1 mark for lack of identication in the solution. • 2 marks pictures of Bert and Ernie are reasonable • 2 marks program correctly switches between Bert and Ernie on mouseclick/keypress • 1 mark for sensible documentation.
Oct 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here