├── A Man Walking In The Rain.C └── README.md /A Man Walking In The Rain.C: -------------------------------------------------------------------------------- 1 | // Author : youtube channel-dotnetmob 2 | // Date : 01-Sep-2015 3 | // Description : CG program for A man walking in rain 4 | 5 | #include 6 | #include 7 | 8 | #define ScreenWidth getmaxx() 9 | #define ScreenHeight getmaxy() 10 | #define GroundY ScreenHeight*0.75 11 | 12 | int ldisp=0; 13 | 14 | void DrawManAndUmbrella(int x,int ldisp) 15 | { 16 | //head 17 | circle(x,GroundY-90,10); 18 | line(x,GroundY-80,x,GroundY-30); 19 | //hand 20 | line(x,GroundY-70,x+10,GroundY-60); 21 | line(x,GroundY-65,x+10,GroundY-55); 22 | line(x+10,GroundY-60,x+20,GroundY-70); 23 | line(x+10,GroundY-55,x+20,GroundY-70); 24 | //legs 25 | line(x,GroundY-30,x+ldisp,GroundY); 26 | line(x,GroundY-30,x-ldisp,GroundY); 27 | //umbrella 28 | pieslice(x+20,GroundY-120,0,180,40); 29 | line(x+20,GroundY-120,x+20,GroundY-70); 30 | } 31 | 32 | void Rain(int x) 33 | { 34 | int i,rx,ry; 35 | for(i=0;i<400;i++) 36 | { 37 | rx=rand() % ScreenWidth; 38 | ry=rand() % ScreenHeight; 39 | if(ryGroundY-120 && (rxx+60))) 42 | line(rx,ry,rx+0.5,ry+4); 43 | } 44 | } 45 | } 46 | void main() 47 | { 48 | int gd=DETECT,gm,x=0; 49 | //Change BGI directory according to yours 50 | initgraph(&gd,&gm,"C:\\TurboC3\\BGI"); 51 | while(!kbhit()) 52 | { 53 | //Draw Ground 54 | line(0,GroundY,ScreenWidth,GroundY); 55 | Rain(x); 56 | ldisp=(ldisp+2)%20; 57 | DrawManAndUmbrella(x,ldisp); 58 | delay(75); 59 | cleardevice(); 60 | x=(x+2)%ScreenWidth; 61 | } 62 | getch(); 63 | } 64 | 65 | 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CG-Program-For-A-Man-Walking-In-Rain 2 | CG Program For A Man Walking In Rain 3 | 4 | ## Get the Code 5 | 6 | ``` 7 | $ git clone https://github.com/CodAffection/CG-Program-For-A-Man-Walking-In-Rain.git 8 | ``` 9 | 10 | ## How it works ? 11 | 12 | :tv: Video tutorial on this same topic 13 | Url : https://youtu.be/wvV4rz4XneU 14 | 15 | Demo for CG Program For A Man Walking In Rain 18 | 19 | 20 | | :bar_chart: | List of Tutorials | | :moneybag: | Support Us | 21 | |--------------------------:|:---------------------|---|---------------------:|:-------------------------------------| 22 | | Angular |http://bit.ly/2KQN9xF | |Paypal | https://goo.gl/bPcyXW | 23 | | Asp.Net Core |http://bit.ly/30fPDMg | |Amazon Affiliate | https://geni.us/JDzpE | 24 | | React |http://bit.ly/325temF | | 25 | | Python |http://bit.ly/2ws4utg | | :point_right: | Follow Us | 26 | | Node.js |https://goo.gl/viJcFs | |Website |http://www.codaffection.com | 27 | | Asp.Net MVC |https://goo.gl/gvjUJ7 | |YouTube |https://www.youtube.com/codaffection | 28 | | Flutter |https://bit.ly/3ggmmJz| |Facebook |https://www.facebook.com/codaffection | 29 | | Web API |https://goo.gl/itVayJ | |Twitter |https://twitter.com/CodAffection | 30 | | MEAN Stack |https://goo.gl/YJPPAH | | 31 | | C# Tutorial |https://goo.gl/s1zJxo | | 32 | | Asp.Net WebForm |https://goo.gl/GXC2aJ | | 33 | | C# WinForm |https://goo.gl/vHS9Hd | | 34 | | MS SQL |https://goo.gl/MLYS9e | | 35 | | Crystal Report |https://goo.gl/5Vou7t | | 36 | | CG Exercises in C Program |https://goo.gl/qEWJCs | | 37 | --------------------------------------------------------------------------------