Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <graphics.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. int gd = DETECT;
  7. int gm;
  8. initgraph(&gd, &gm, NULL);
  9. int i = 0;
  10. int m = 105;
  11.  
  12. //Pokemon
  13.  
  14. for (int j = 0; j <= 540; ++j) {
  15. double x_in = cos(abs(30 - i) * 0.0175) * 30.0 + 50;
  16. double y_in = sin(abs(30 - i) * 0.0175) * 30.0 + 80;
  17. double y_dc = 80 - sin(abs(30 - i) * 0.0175) * 30.0;
  18. if (i <= 30) arc (50 + j, 80, 30 - i, 330 + i, 30);
  19. else arc (50 + j, 80, i - 30, 390 - i, 30);
  20. circle (55 + j, 63, 5);
  21. line (50 + j, 80, x_in + j, y_dc);
  22. line (50 + j, 80, x_in + j, y_in);
  23.  
  24. //foods
  25.  
  26. if (i != 30 && m < 630) circle (m, 80, 5);
  27. else {
  28. m += 60;
  29. }
  30. if (i < 60) ++i;
  31. else i = 0;
  32. delay(20);
  33. if (j != 540) cleardevice();
  34. }
  35.  
  36. getch();
  37. closegraph();
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement