Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Degree of Difficulty: Easy to Moderate Disco Towers is an exciting dance club housed in a three-storey skyscraper. It is known for its wild disco

image text in transcribed

Degree of Difficulty: Easy to Moderate Disco Towers is an exciting dance club housed in a three-storey skyscraper. It is known for its wild disco parties featuring red and green lights. Your task is to create a simulation in Processing of Disco Towers during a typical Friday night dance party! For this simulation, we want to use a canvas of size 255 px by 255 px. Select a sky-coloured background (such as dark blue) on which to draw a simple side view of the skyscraper. The building itself should be a simple gray rectangle approximately centered on the x-axis of the canvas. The building should have six recetanglar windows arranged in a grid format and should initially be filled in yellow. See the first image below for an idea of what your skyscraper should look like. On a mouse click, the colour of all six windows should change depending on the current position of the mouse. The red component of the window's colour should be set to the current y-coordinate of the mouse and the green component should be set to the current x-coordinate. This behaviour is similar to exercise 4 of the chapter 6 lectures. Hint: You may want to write one or two of your own functions to better organize your program. As a rule, if you ever find yourself duplicating the same code in more than one spot, you should almost certainly encapsulate that code in a function! gure 2: Initial skyscraper image before any clicks are made. (left). A mouse click in the top left corner of the nvas results in the windows changing to black. (middle). A mouse click on the left side closer to the middle of the canvas causes dark red windows. (right). What to Hand In Hand in your Processing program in a file called a2q2.pyde Degree of Difficulty: Easy to Moderate Disco Towers is an exciting dance club housed in a three-storey skyscraper. It is known for its wild disco parties featuring red and green lights. Your task is to create a simulation in Processing of Disco Towers during a typical Friday night dance party! For this simulation, we want to use a canvas of size 255 px by 255 px. Select a sky-coloured background (such as dark blue) on which to draw a simple side view of the skyscraper. The building itself should be a simple gray rectangle approximately centered on the x-axis of the canvas. The building should have six recetanglar windows arranged in a grid format and should initially be filled in yellow. See the first image below for an idea of what your skyscraper should look like. On a mouse click, the colour of all six windows should change depending on the current position of the mouse. The red component of the window's colour should be set to the current y-coordinate of the mouse and the green component should be set to the current x-coordinate. This behaviour is similar to exercise 4 of the chapter 6 lectures. Hint: You may want to write one or two of your own functions to better organize your program. As a rule, if you ever find yourself duplicating the same code in more than one spot, you should almost certainly encapsulate that code in a function! gure 2: Initial skyscraper image before any clicks are made. (left). A mouse click in the top left corner of the nvas results in the windows changing to black. (middle). A mouse click on the left side closer to the middle of the canvas causes dark red windows. (right). What to Hand In Hand in your Processing program in a file called a2q2.pyde

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

Students also viewed these Databases questions

Question

Persuading Your Audience Strategies for

Answered: 1 week ago