123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Egg Game in C

--------------------------------------------------------------------------------

Description : This is a game, where there are no. of eggs falling from the top of the screen randomly. The player just have to save them from falling on the ground.

#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()
{
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,"");

int count=0;
maxx=getmaxx();
maxy=getmaxy();

setbkcolor(1);
setviewport(0,0,maxx,maxy,1);
gotoxy(26,1);

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);

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
 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG