Add to Favorites    Make Home Page 5847 Online  
 Language Categories  
 Our Services  

Home » C Home » Games and Graphics Home » VARUN'S EGG_GAME

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title VARUN'S EGG_GAME
Author VARUN KUMAR SONKER
Author Email VARUN_SONKERRREDIFFMAIL.COM
Description THIS GAME IS BUILT WITH THE PURPOSE TO PROVIDE THE PROGRAMMERS THE ABILITY TO THINK ABOUT LOGIC.
THIS GAME HAS 4 STAGES WITH VARING SPEED OF FALLING EGGS. YOU HAVE TO GO FOR ALL THE FOR, IF REQUIRED THE GAME CAN BE HALTED IN BETWEEN AS WELL BY SIMPLY PRESSING ANY KEY.
Category C » Games and Graphics
Hits 366062
Code Select and Copy the Code
// VARUN'S EGG_GAME. #include"dos.h" #include"graphics.h" #include<stdio.h> #include<conio.h> #include<process.h> #include<dos.h> #include<stdlib.h> #include<iostream.h> union REGS i,o; main() { FILE *fp; fp=fopen("record.txt","r"); if(fp=NULL) cout<<"THE GAME HAS SOME PROBLEMS FOR MORE DETAILS CONTECT varun..."; void help(); int initmouse(); int restrictmouseptr(int,int,int,int); int getmousepos(int *,int *,int *); int showmouseptr(); int gd=DETECT,gm,maxx,maxy,x,y,button; initgraph(&gd,&gm,"c:\turboc3\bin"); //circle(100,100,40); int count=0; maxx=getmaxx(); maxy=getmaxy(); // rectangle(0,0,maxx,maxy); setbkcolor(1); setviewport(0,0,maxx,maxy,1); gotoxy(26,1); //printf("mouse demonstration program"); if(initmouse()==0) { closegraph(); restorecrtmode(); //to go back to normal graphics mode or deleting viewport. printf(" mouse driver not loaded"); exit(1); } restrictmouseptr(0,getmaxy()-20,maxx,getmaxy()-15); //showmouseptr(); //gotoxy(1,2); //printf("left button"); //gotoxy(15,2); //printf("right button"); //printf("press any key to exit...."); int a=30;int b=0; setcolor(0); setfillstyle(1,15); int score=0; count=20; int s=5; int level=0; char name[40]; gotoxy(5,2); cout<<"PLEASE ENTER YOUR SWEET NAME::-"; gets(name); gotoxy(5,2); cout<<" "; while(!kbhit()) { getmousepos(&button,&x,&y); // gotoxy(5,3); // (button&1)==1 ? printf("down") : printf("up"); //gotoxy(20,3); // (button&1)==2 ? printf("down") : printf("up"); setcolor(15); setfillstyle(1,15); fillellipse(a,b,10,15); if((b>getmaxy()-20)&&(b<=getmaxy()-15)) { if(a>=(x-20)&&(a<=(x+60))) { score+=10; gotoxy(320,2); textcolor(13); cout<<"your score: "<<score; } } if(b>getmaxy()+40) { b=0; a=random(getmaxx()); gotoxy(10,2); cout<<"eggs left: "<<count; count--; if(count==-1) { gotoxy(32,10); cout<<"LEVEL COMPLETED."; level++; if(level==4) { goto varun; } count=10; s++; getch(); gotoxy(32,10); cout<<" "; } } setcolor(10); line(x,getmaxy(),x+40,getmaxy()); line(x,getmaxy(),x-20,getmaxy()-20); line(x+40,getmaxy(),x+60,getmaxy()-20); line(x-20,getmaxy()-20,x+60,getmaxy()-20); delay(10); setcolor(0); line(x,getmaxy(),x+40,getmaxy()); line(x,getmaxy(),x-20,getmaxy()-20); line(x+40,getmaxy(),x+60,getmaxy()-20); line(x-20,getmaxy()-20,x+60,getmaxy()-20); setfillstyle(1,0); fillellipse(a,b,10,15); b+=s; } varun: FILE *p; p=fopen("RECORD.TXT","w+"); if(p==NULL) cout<<"DATABASE NOT ACCESSABLE"; fputc('b',p); gotoxy(30,12); cout<<"EXCELLENT WORK "<<name; gotoxy(33,15); cout<<"GAME OVER. "; gotoxy(32,18); cout<<"YOUR SCORE:"<<score; gotoxy(58,24); cout<<"COMPOSED BY:"; gotoxy(55,25); cout<<"VARUN KUMAR SONKER"; gotoxy(30,10); char h_score=0; h_score=fgetc(fp); cout<<"GREATEST SCORE::"<< "560...."; char varun=fgetc(fp); getch(); getch(); } initmouse() { i.x.ax=0;//for initialising mouse. int86(0x33,&i,&o); return(o.x.ax); } showmouseptr() { i.x.ax=1; // for displaying mouse pointer. int86(0x33,&i,&o); } restrictmouseptr(int x1,int y1,int x2,int y2) { i.x.ax=7; //to define the upper left boundry of mouse. i.x.cx=x1; i.x.dx=x2; int86(0x33,&i,&o); i.x.ax=8; //to define the bottom right boundry of mouse. i.x.cx=y1; i.x.dx=y2; int86(0x33,&i,&o); } getmousepos(int *button,int *x, int *y) { i.x.ax=3; //to move mouse. int86(0x33,&i,&o); *button=o.x.bx; *x=o.x.cx; *y=o.x.dx; }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi ¦Õ¤ ?¤Ð Ãß??ÝÐÝ
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=540


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review