Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ython Assignment #3-Giraffe 1. You will again need the setup and draw functions. The window should be 800 x 800 2. Use background to prevent

image text in transcribedimage text in transcribed

ython Assignment #3-Giraffe 1. You will again need the setup and draw functions. The window should be 800 x 800 2. Use background to prevent a snake effect when the ears move, 29 ellipses (6 where duplicates in decision structures for the pupils and ears that enable movement), 1 rect for the neck, 4 lines (2 for the horns and 2 for the toes) with a stroke Weight, fill, and I used stroke and noStroke. 3. Create a global Boolean variable above the setup function for the mouse or touch pad 4. Make a mousePressed function below and outside of the draw function, the code in the function should change the Boolean variable value using a not operator whenever a mouse button is pressed. In the draw function: We will be manipulating the value stored by the global variable, so be sure to use the global statement for the variable or your code won't work. 5. Place a Conditional structure (if - else) testing the Boolean variable in the draw function before the code for the spots. a. In one Condition the spots colors should be a solid color. b. In the other Condition, the spots colors should flip between random colors. To do this, use the random() function for each of the three RGB colors values. 6. Place another Conditional structure (if - else) testing the Boolean variable in the draw function where the code for the ears are. a. In one Condition, make the ears point outward like in the image above. b. In the other Condition, make the ears stand up by changing the ellipses. 7. Create 2 new global variables for the pupils x coordinates. Assign the variables values based on where you want the pupils to start out at, either the left side or right side of the eyes. 8. The values of these variables will change, so again use the global statement for the variables. 9. Place a new Conditional structure (if - else) testing whether the cursor is left or right of the middle point of your window where the code for the pupils are. Change the value of the variables in each Condition to affect the change in the x coordinate locations, a. In one Condition: When the cursor is on the left side of the screen, the pupils should be looking left. b. In the other Condition: When the cursor is on the right side of the screen, the pupils should be looking right. ython Assignment #3-Giraffe 1. You will again need the setup and draw functions. The window should be 800 x 800 2. Use background to prevent a snake effect when the ears move, 29 ellipses (6 where duplicates in decision structures for the pupils and ears that enable movement), 1 rect for the neck, 4 lines (2 for the horns and 2 for the toes) with a stroke Weight, fill, and I used stroke and noStroke. 3. Create a global Boolean variable above the setup function for the mouse or touch pad 4. Make a mousePressed function below and outside of the draw function, the code in the function should change the Boolean variable value using a not operator whenever a mouse button is pressed. In the draw function: We will be manipulating the value stored by the global variable, so be sure to use the global statement for the variable or your code won't work. 5. Place a Conditional structure (if - else) testing the Boolean variable in the draw function before the code for the spots. a. In one Condition the spots colors should be a solid color. b. In the other Condition, the spots colors should flip between random colors. To do this, use the random() function for each of the three RGB colors values. 6. Place another Conditional structure (if - else) testing the Boolean variable in the draw function where the code for the ears are. a. In one Condition, make the ears point outward like in the image above. b. In the other Condition, make the ears stand up by changing the ellipses. 7. Create 2 new global variables for the pupils x coordinates. Assign the variables values based on where you want the pupils to start out at, either the left side or right side of the eyes. 8. The values of these variables will change, so again use the global statement for the variables. 9. Place a new Conditional structure (if - else) testing whether the cursor is left or right of the middle point of your window where the code for the pupils are. Change the value of the variables in each Condition to affect the change in the x coordinate locations, a. In one Condition: When the cursor is on the left side of the screen, the pupils should be looking left. b. In the other Condition: When the cursor is on the right side of the screen, the pupils should be looking right

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions