Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <graphics.h>
- using namespace std;
- struct kulka{
- int x,y;
- int r;
- };
- int main( )
- {
- initwindow( 640 , 480 , "WinBGIm" );
- kulka kula;
- kula.x=320;
- kula.y=240;
- double v0=100;
- kula.r=5;
- int x0=kula.x;
- int y0=kula.y;
- double t=0.08;
- setcolor(RED);
- circle(kula.x,kula.y,kula.r);
- while(!kbhit()){
- delay(10);
- setcolor(BLACK);
- circle(kula.x,kula.y,kula.r);
- kula.x = kula.x + v0 * t;
- setcolor(RED);
- circle(kula.x,kula.y,kula.r);
- }
- while( !kbhit() );
- closegraph( );
- return( 0 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement