Question: C++ Only// Requirements Create an object structure (and use it) o This structure must minimally contain 3 integers: an x, a y and color. o
C++ Only//
Requirements
Create an object structure (and use it)
o This structure must minimally contain 3 integers: an x, a y and color.
o A color can be stored in an int, as makecolor() returns an integer.
Create a function that will print out a pixel-by-pixel drawn object.
o Your function should have as parameters: a BITMAT * buffer, the object structure (x and y coordinate of the new object and its color), the size of the object (e.g. length and height of the rectangle). o You must draw this object pixel by pixel.
o The rectangle is the easiest to draw. Please use objects like (circles, triangles, angled lines)
Use objects drawn using Allegro functions (circle, triangles, etc.).
Display an object a certain number of times using a loop.
o This object can be the pixel-by-pixel object of yours, or an Allegro object.
Include user input: use at least 4 key to have the user make some selection.
o They could select the type of object you use, the color of the object, or increase the amount of objects displayed, for instance. This list is not exhaustive. 3
Use randomness. This means that the program will randomly pick a value between a specific set of possibilities. You must use randomness at least twice in the program. o It could pick the shade of a color by selecting a value between 0 and 255, for instance.
o You can also consider having the program select a value that is proportional to the previous value. For instance, if the previous shade of red was 120, then the next value selected must be between 100 and 140 (you pick a random value between -20 and 20 and add the previous value, 120 to it).
Save the current screen to a BMP if the user presses on the key ENTER.
o Give it a different name every time you save a file (for instance: screen1.bmp, screen2.bmp, screen3.bmp).
o Hint: use a counter variable to keep track of how many screen saves youve done do far. Append this counter to the string with the file name. o Note that this does not count towards your user input.
Use the escape key to exit the program o Note that this does not count towards your user input.
You must have at least 4 functions in addition to the main function. These must be relevant and meaningful. One of those functions can be the one to draw your object.
Make the resulting art aesthetically pleasing. Have fun with this. Play around with different shapes, create something nice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
