1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#include <iostream>
#include <graphics.h>
#include <time.h>
using namespace std;
int main()
{
int g=0 , d=DETECT;
int rshapes,y=-100 , circler=45;
initgraph(&g, &d, "");
srand(time(NULL));
initwindow(400 , 900 , "Game");
int circle_x = 200;
//Intro
setcolor(10);
settextstyle(COMPLEX_FONT , HORIZ_DIR , 200);
outtextxy(100, 285, "SRGP\n");
setcolor(12);
settextstyle(GOTHIC_FONT , HORIZ_DIR , 47);
outtextxy(100 , 300 , "GAME");
delay(2000);
cleardevice();
char ch;
for(int i=1 ; i<=40 ; i++)
{
rshapes= rand()%3 + 1;
for(y=-100 ; y<=900-circler ; y++)
{
if(rshapes== 1)
{
setcolor(4);
circle(200 , y , circler);
}
else if(rshapes== 2)
{
setcolor(5);
circle(200 , y , circler);
}
else if(rshapes== 3)
{
setcolor(6);
circle(200 , y , circler);
}
delay(20);
setcolor(0);
circle(200 , y , circler);
}
}
getch();
return 0;
}
|