So I have a school assignment where we have to make a little program that makes random abstract art out of drawn rectangles.
This is what is should look like:
It's the top right element of the canvas.
Now the function has to consist of this: When you press 'backspace' the program should generate a new abstract 'painting' within the boarders and it should consist of 15 new random sized and random colored rectangles.
We work in a custom game engine that our teacher made for us. It uses C# as base.
I basically got everything to work. When I press backspace 15 random rectangles are being drawn on the canvas with random colors. The only problem is that when I press backspace again, only the colors change but not the rectangles.
Here is a pastebin link to the code I made so far: http://pastebin.com/YCrjb2T1
So basically for the colors I made a list (CreateRandomColorList) of int arrays. The int arrays are being filled with 3 random numbers between 0 and 255 (RGB colors). These 3 numbers can be given as parameters to set the color. So everytime you press backspace the rectangles are given new random colors.
I wanted to do exactly the same for the rectangles themselves but that did not seem to work.
There are 3 parameters you can give to a rectangle: The x position on the canvas, the y position on the canvas, the width and the height.
Any insights/tips on what could be wrong would be welcome, I hope my explanation is good enough.