#include<allegro.h>
#include<stdlib.h>
int rect_x=0,rect_y=0;
BITMAP *buffer;
int r=0,b=0,g=0;
int radius=0;
int i=0;
int k=0;
int main()
{
allegro_init();
install_keyboard();
set_color_depth(32);
if(set_gfx_mode(GFX_AUTODETECT_WINDOWED,1200,700,0,0)!=0)
{
set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("error in initiallization of screen");
allegro_exit();
exit(1);
}
srand(time(NULL));
buffer=create_bitmap(SCREEN_W,SCREEN_H); clear_bitmap(buffer);
srand(time(NULL));
rect_x=SCREEN_W/2;
rect_y=SCREEN_H/2;
while((!key[KEY_ESC]))
{
r=rand()%200+20;
g=rand()%255;
b=rand()%220;
if(i==350) radius=0,i=0,k=0,clear_bitmap(buffer);
arc(buffer,0,SCREEN_H,64,0,radius,makecol(r,g,b));//right to bottom
arc(buffer,0,0,64,0,radius,makecol(g,b,r));//left to bottom
arc(buffer,SCREEN_W,0,-64,-128,radius,makecol(b,r,g));//top to left
arc(buffer,SCREEN_W,SCREEN_H,64,0,radius,makecol(g,g,b));
//circle(buffer,SCREEN_W/2,SCREEN_H/2,radius,makecol(0,0,0));
//rect(buffer,rect_x-k,rect_y-k,rect_x+k,rect_y+k,makecol(0,0,0));
blit(buffer,screen,0,0,0,0,buffer->w,buffer->h);
radius+=4;
i++;
k+=2;
rest(20);
}
destroy_bitmap(buffer);
}END_OF_MAIN();
#include<stdlib.h>
int rect_x=0,rect_y=0;
BITMAP *buffer;
int r=0,b=0,g=0;
int radius=0;
int i=0;
int k=0;
int main()
{
allegro_init();
install_keyboard();
set_color_depth(32);
if(set_gfx_mode(GFX_AUTODETECT_WINDOWED,1200,700,0,0)!=0)
{
set_gfx_mode(GFX_TEXT,0,0,0,0);
allegro_message("error in initiallization of screen");
allegro_exit();
exit(1);
}
srand(time(NULL));
buffer=create_bitmap(SCREEN_W,SCREEN_H); clear_bitmap(buffer);
srand(time(NULL));
rect_x=SCREEN_W/2;
rect_y=SCREEN_H/2;
while((!key[KEY_ESC]))
{
r=rand()%200+20;
g=rand()%255;
b=rand()%220;
if(i==350) radius=0,i=0,k=0,clear_bitmap(buffer);
arc(buffer,0,SCREEN_H,64,0,radius,makecol(r,g,b));//right to bottom
arc(buffer,0,0,64,0,radius,makecol(g,b,r));//left to bottom
arc(buffer,SCREEN_W,0,-64,-128,radius,makecol(b,r,g));//top to left
arc(buffer,SCREEN_W,SCREEN_H,64,0,radius,makecol(g,g,b));
//circle(buffer,SCREEN_W/2,SCREEN_H/2,radius,makecol(0,0,0));
//rect(buffer,rect_x-k,rect_y-k,rect_x+k,rect_y+k,makecol(0,0,0));
blit(buffer,screen,0,0,0,0,buffer->w,buffer->h);
radius+=4;
i++;
k+=2;
rest(20);
}
destroy_bitmap(buffer);
}END_OF_MAIN();
No comments:
Post a Comment