Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Draw a dark blue background on a 3 0 0 3 0 0 pixel canvas. Draw your water drop as a light blue circle 2

Draw a dark blue background on a 300300 pixel canvas.
Draw your water drop as a light blue circle 20 pixels in diameter initially drawn in the centre of the canvas.
Draw the ripple as a darker shade of blue than the water droplet, but brighter than the background. It should be drawn underneath the centre of the water droplet (so we can see the point of impact). but drawn over the background (so we can see the ripple expanding). The ripple's diameter should expand by 1 pixel on every call to draw ().
On a mouse click, move the water droplet's location to the mouse coordinates and restart its ripple animation as if the water droplet fell into the water at that point.
Your program should use Model-View-Controller design
Figure 2: Water droplet with its ripple expanding outwards in different locations.
The following are some hints as to how to build your program in particular you will need to us variables to keep track of various pieces of information for this program.
Because the size of the ripple is changing, you will need to continually re-draw both the droplet and the ripple. Therefore, you will need to use two variables to store the current x and y coordinates of the droplet.
Because the ripple is growing, you will need to use another variable to keep track of the current size (ie diameter) of the ripple
Fhe chattenge to this question is to figure out when and how to update the values of the varables mentioned above Spend some time planning your approach, and think carefully about the behaviour of Pro-
Search
image text in transcribed

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago