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
|
#include "bg.h"
#include <fstream>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
bgCreateWindow();
float x=-16;
float y=0;
bgClearScreen();
while(1)
{
while (x<-1)
{
bgClearScreen();
bgDrawCircle (x,y,1); x+=.1; y+=.1;
Sleep (10);
bgUpdateDisplay();
}
while (x<15)
{
bgClearScreen();
bgDrawBox (1+x,1+y,x-2,y-2); x+=.1; y-=.1;
Sleep (10);
BgUpdateDisplay();
}
while (x>1)
{
bgClearScreen();
bgDrawTriangle (x-1,y+1,x+2,y+1,x-4,y-3); x-=.1; y-=.1;
Sleep (10);
BgUpdateDisplay();
}
while (x>-15)
{
bgClearScreen();
bgDrawTriangle (x+0,y+1.5,x+0,y-.5,x+1,y-1);
bgDrawTriangle (x+1,y+2.5,x+1,y-1.5,x+2,y-2);
bgDrawTriangle (x+2,y+3.5,x+2,y-2,x+3,y-3); x=.1; y=.1;
Sleep (10);
}
bgUpdateDisplay();
bgPause();
bgDestroyWindow();
return 0;
}
|