Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3.  
  4. #include <graphics.h>
  5.  
  6. using namespace std;
  7.  
  8. struct kulka{
  9. int x,y;
  10. int r;
  11.  
  12. };
  13.  
  14.  
  15. int main( )
  16. {
  17. initwindow( 640 , 480 , "WinBGIm" );
  18.  
  19.  
  20. kulka kula;
  21. kula.x=320;
  22. kula.y=240;
  23. double v0=100;
  24. kula.r=5;
  25. int x0=kula.x;
  26. int y0=kula.y;
  27. double t=0.08;
  28.  
  29. setcolor(RED);
  30. circle(kula.x,kula.y,kula.r);
  31. while(!kbhit()){
  32.  
  33. delay(10);
  34. setcolor(BLACK);
  35. circle(kula.x,kula.y,kula.r);
  36. kula.x = kula.x + v0 * t;
  37. setcolor(RED);
  38. circle(kula.x,kula.y,kula.r);
  39.  
  40.  
  41.  
  42. }
  43.  
  44.  
  45.  
  46. while( !kbhit() );
  47.  
  48.  
  49.  
  50. closegraph( );
  51.  
  52. return( 0 );
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement