How to design a C++ project for beautiful animated scenery?

Introduction to the project 

How to design a C++ project for beautiful animated scenery? This project presents a beautiful animated scenery . The objective of the animated scenery is to introduce graphics in C++ programming, and by using tubro c graphical interface, we integrate different shapes to make a meaningful object. To ensure that this objective can be accomplished, the scenery incorporates with various animated objects(e.g. moving cycle, growing sun, a quotation changes its color) and a house on the right side of the road way, that enhances the beauty of scenery. The project code provides a brief concept of C++ Programming techniques used in scenery. We have used all the concepts that we have studied so far to show our skills in a different way and polish them.

Project Explanation

In our project, we have introduced graphics through an animated scenery. Our program code firstly includes an introductory page which states the title of course, the name of the instructor and the persons who submitted the project. Then the animation starts upon clicking any key. Animation has a roadway with a house on right side of it. A cycle moving towards the house. Cycle moves with code consisting of loop that allow the cycle to move. After then a sun arouses that is growing and glowing bright yellow in color. The animation concludes with a meaningful quotation that states
“If you want to shine like a sun, first burn like a sun.”

Flowchart of the project

flow chart of project
flow chart of project

C++ code for scenery designing project

Program Code
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
/// Front Page ///
void front(void)
{
while(!kbhit()) { settextstyle(4,0,3); setcolor(1);
outtextxy(170,50,”Introduction to Programming”); setcolor(2);
outtextxy(260,90,”Final Project”); setcolor(4);
outtextxy(150,130,”Submitted to: Engr Asma Mushtaq”); setcolor(5);
outtextxy(180,170,”Presented by: Maryam Charles”); setcolor(6);
outtextxy(330,200,”Rutba Khalid”); setcolor(7);
outtextxy(200,300,”Press any key to start “);
}
cleardevice();
}
/// Sun Animation & Qoutation ///
void sunquote(void)
{
int arr[3]={13,3,2}; for(int y=0;y<50;y++)
{ setcolor(14); circle(510,100,y); delay(30); }
settextstyle(4,0,3); for(int d=1;d<4;d++)
{
setcolor(arr[d]);
outtextxy(40,180,”If you want to shine like a sun,first burn like a sun”);
delay(500); setcolor(0);
outtextxy(40,180,”If you want to shine like a sun,first burn like a sun”); delay(150); }
}

/// Moving Cycle Animation ///
void cycle(void)
{
for(int m=0;m<160;m++)
{ setcolor(15); circle(40+m,360,40); circle(185+m,360,40); line(40+m,360,80+m,315); line(115+m,360,155+m,315); line(40+m,360,115+m,360); line(80+m,315,155+m,315); line(185+m,360,135+m,285); line(135+m,285,120+m,285); line(80+m,315,80+m,305); line(70+m,305,90+m,305); setcolor(0); delay(20); circle(40+m,360,40); circle(185+m,360,40); line(40+m,360,80+m,315); line(115+m,360,155+m,315); line(40+m,360,115+m,360); line(80+m,315,155+m,315); line(185+m,360,135+m,285); line(135+m,285,120,285); line(80+m,315,80+m,305); line(70+m,305,90+m,305);
}
}
/// House ///
void house(void)
{
line(400,400,400,300); line(450,400,450,300); line(400,300,425,260); line(450,300,425,260); line(400,300,450,300); line(550,400,550,300); line(550,300,450,300); line(550,300,525,260); line(525,260,425,260); line(410,400,410,350);

line(440,400,440,350); line(410,350,440,350); circle(415,375,3); line(470,325,470,375); line(530,325,530,375); line(470,375,530,375); line(470,325,530,325); line(500,325,500,375); line(470,350,530,350);
}
/// End Page ///
int end(void){ int mc; cleardevice(); setbkcolor(11); setcolor(13);
outtextxy(40,180,”Select one of the option given below”); outtextxy(40,210,”Press 1 and then entre to restart”); outtextxy(40,240,”Press 2 and then entre to quit”); cin>>mc; cleardevice(); return mc;
}
///Main function ///
void main() { clrscr(); int gd=DETECT,gm;
initgraph(&gd,&gm,”c:\\turboc3\\BGI”); label1: setbkcolor(11); front(); setbkcolor(0); line(0,403,650,403); house();
cycle(); sunquote(); label2: int mc=end(); if (mc==1){ goto label1;} else if (mc==2){
outtextxy(280,280,”Ok Bye !”);} else{ goto label2;} getch();
}

Output of project

scenery animation
scenery animation

Also read here for more projects

https://eevibes.com/engineering-projects/

Leave a Reply

Your email address will not be published. Required fields are marked *