├── Animating Rain.C └── README.md /Animating Rain.C: -------------------------------------------------------------------------------- 1 | // Author : youtube channel-dotnetmob 2 | // Date : 21-Jun-2015 3 | // Description : program for animating rain 4 | 5 | #include 6 | #include 7 | 8 | #define WIDTH getmaxx() 9 | #define HEIGHT getmaxy() 10 | #define COLOR_RED "\x1b[31m" 11 | #define COLOR_RESET "\x1b[0m" 12 | 13 | int isContinue=1,d=5,del=500; 14 | 15 | void ChangeOption() 16 | { 17 | switch(getch()) 18 | { 19 | case 'a'://wind to left 20 | case 'A': 21 | d=-5; 22 | break; 23 | 24 | case 'd'://wind to right 25 | case 'D': 26 | d=5; 27 | break; 28 | 29 | case 's'://no wind 30 | case 'S': 31 | d=0; 32 | break; 33 | 34 | case 'w'://increase rain speed 35 | case 'W': 36 | if(del!=100) 37 | del-=200; 38 | break; 39 | 40 | case 'X'://decrease rain speed 41 | case 'x': 42 | if(del!=1100) 43 | del+=200; 44 | break; 45 | 46 | case ' '://stop raining 47 | isContinue=0; 48 | break; 49 | } 50 | } 51 | 52 | void main() 53 | { 54 | int gd=DETECT,gm,xr,yr,i,j=0; 55 | initgraph(&gd,&gm,"C:\\TurboC3\\BGI"); 56 | do 57 | { 58 | textcolor(0); 59 | textbackground(15); 60 | 61 | printf(COLOR_RESET"CHANGE WIND DIRECTION:"); 62 | printf(COLOR_RED" S(s): No wind A(a) : right - left D(d): left - right\n"); 63 | printf(COLOR_RESET"CHANGE SPEED: "); 64 | printf(COLOR_RED"W(w): Speed Up X(x): Speed Down Space: Stop Rain"); 65 | 66 | for(i=10;i<300;i++) 67 | { 68 | xr=rand()%640; 69 | yr=rand()%345; 70 | 71 | if(j%2==0) 72 | line(xr,yr,xr+d,yr+5); 73 | else 74 | line(xr+10,yr,xr+10+d,yr+5); 75 | } 76 | 77 | delay(del); 78 | clrscr(); 79 | cleardevice(); 80 | 81 | j++; 82 | if(kbhit()) 83 | ChangeOption(); 84 | }while(isContinue); 85 | } 86 | 87 | 88 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rain-Animation-in-C-Program 2 | Showing Rain Animations in C Program. 3 | 4 | 5 | ## How it works ? 6 | 7 | :tv: Video tutorial on this same topic 8 | Url : https://youtu.be/M-4LndgpM9g 9 | 10 | Demo for Bresenham's Circle Program in C 13 | 14 | 15 | | :bar_chart: | List of Tutorials | | :moneybag: | Support Us | 16 | |--------------------------:|:---------------------|---|---------------------:|:-------------------------------------| 17 | | Angular |http://bit.ly/2KQN9xF | |Paypal | https://goo.gl/bPcyXW | 18 | | Asp.Net Core |http://bit.ly/30fPDMg | |Amazon Affiliate | https://geni.us/JDzpE | 19 | | React |http://bit.ly/325temF | | 20 | | Python |http://bit.ly/2ws4utg | | :point_right: | Follow Us | 21 | | Node.js |https://goo.gl/viJcFs | |Website |http://www.codaffection.com | 22 | | Asp.Net MVC |https://goo.gl/gvjUJ7 | |YouTube |https://www.youtube.com/codaffection | 23 | | Flutter |https://bit.ly/3ggmmJz| |Facebook |https://www.facebook.com/codaffection | 24 | | Web API |https://goo.gl/itVayJ | |Twitter |https://twitter.com/CodAffection | 25 | | MEAN Stack |https://goo.gl/YJPPAH | | 26 | | C# Tutorial |https://goo.gl/s1zJxo | | 27 | | Asp.Net WebForm |https://goo.gl/GXC2aJ | | 28 | | C# WinForm |https://goo.gl/vHS9Hd | | 29 | | MS SQL |https://goo.gl/MLYS9e | | 30 | | Crystal Report |https://goo.gl/5Vou7t | | 31 | | CG Exercises in C Program |https://goo.gl/qEWJCs | | 32 | --------------------------------------------------------------------------------