1.1-Introductie-Programmeren

Drawing multiple triangles - 2

Difficulty: Filled Filled Outlined

Create a drawTriangle(int x, int y, int size) method that allows you to draw a triangle on a certain given location with a certain size. The location is entered as a x,y coordinate which refers to the top-left corner of the triangle (virtual) box.

Fill out the screen with random triangles as shown in the example by invoking your newly created method several times. Also change the size of each triangle by using the getRandomValuemethod from SaxionApp.

Example

Example

You can use the image below to figure out how to calculate the triangle coordinates. Triangle draw help