Flags Tutorial

From Progzoo

Revision as of 17:40, 7 January 2012 by Andr3w (Talk | contribs)

In these exercises you draw the flags of various countries using graphics commands. You make use of the Graphics2D class to complete these.

You will be using methods such as g.fillRect(x,y,h,w) to fill a rectangle w width and h high with the top left corner at (x,y).

Tut1page1.png
Flags with Rectangles
The rectangles tutorial has you drawing the flags of Libya, France, Germany and Palau. You can draw these flags using only rectangles of different colors. These exercise introduce the basic graphics commands.
Tut1page2.png
Flags with Lines
The lines tutorial includes flags that require lines. By changing the color and the thickness of the lines drawn you can produce the flags of England, Scotland, Botswana and Trinidad and Tobago.
Tut1page3.png
Flags with Polygons
The polygons tutorial includes flags made with triangles and other polygons. The flags of Napier University, Jamaica and the Bahamas and the Seychelles require triangles and quadrilaterals.
Tut1page4.png
Flags with Stars
The stars tutorial includes flags that feature five pointed stars. In each example the star has already been defined as a polygon. You have to translate and scale the star to show Vietnam, Panama, Bosina Herzeginia and Zaire.
Tut1page5.png
Flags that Repeat
The repeats tutorial focuses on flags that include repetition. You can use loops, such as for to perform the same action many times. Draw the flag of Bahrain, Qatar, India, Namibia and the European Union.
Tut1page6.png
Difficult Flags
The harder tutorials includes flags where the repetition is harder to exploited. To do this well you will use methods and parameters.
Tut1page7.png
Road Signs
The road signs tutorials includes a whole range of problems, the first few are easy but the last lot represent a real challenge.
[[|]]
[[Image:|link=]]
[[|]]
[[Image:|link=]]

Animation