In this article, we will discuss how to design a 2D football ground using computer graphics.
- At first, create a rectangle using the rectangle() function. This will act as the Ground Outline and draw two lines using the line() function.
- For coloring the middle part of two lines with White using the setfillstyle() and floodfill() functions.
- Then draw two circles using the circle() function and also color Middle part with White using setfillstyle() & floodfill() functions.
- Draw a total of four rectangles using the rectangle() function on the left side.
- Among them, two will act as the outer outline and two will act as the Inner outline.
- Then color the middle parts of rectangles with white using the setfillstyle() & floodfill() functions.
- Draw the two half circles using the arc() function and also color it with white color using setfillstyle() & floodfill() functions.
- Perform all the above operations on the right side also.
Below is the implementation of the above approach:
Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.