C program to display the animated firecrackers with a message using graphics
In this article, we will discuss how to draw the Rocket using Graphics.
- In main() function, call the launch() function. The launch() function is a base which will repeatedly call the fire() & mess() functions until given condition is satisfied.
- The mess() function will contain the Birthday Message.
- To portray the birthday message, use the settextstyle() & outtextxy() functions. These conditions, with input from the user, determine the maximum height the fireworks can reach.
- Note that any text can be written before the function call.
- The fire() function initially calls the cracker() function.
- The cracker() function implements the five firecrackers with the aid of triangles using the line() function in graphics.
- To color setfillstyle() & floodfill() functions are be used.
- The fire() function will implement multiple lines of the same length using the line() function.
- The header file “time.h” is used for the delay function present in it. The delay function will allow us to add variation to the animation.
Below is the implementation of the above approach:
My Personal Notes arrow_drop_up
Please Login to comment...