Fractal of polygons

The fractal we will now draw is formed of a polygon, with little polygons on each corner. The prototype of the method drawing it is the following:
[!java]void [/!]polygonFractal ([!java]int [/!]levels[!scala]:Int[/!], [!java]int [/!]sides[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])

Have a look at each world's objective view to understand how to write the function.