Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <graphics.h>
- #include <math.h>
- int main()
- {
- int gd = DETECT;
- int gm;
- initgraph(&gd, &gm, NULL);
- int i = 0;
- int m = 105;
- //Pokemon
- for (int j = 0; j <= 540; ++j) {
- double x_in = cos(abs(30 - i) * 0.0175) * 30.0 + 50;
- double y_in = sin(abs(30 - i) * 0.0175) * 30.0 + 80;
- double y_dc = 80 - sin(abs(30 - i) * 0.0175) * 30.0;
- if (i <= 30) arc (50 + j, 80, 30 - i, 330 + i, 30);
- else arc (50 + j, 80, i - 30, 390 - i, 30);
- circle (55 + j, 63, 5);
- line (50 + j, 80, x_in + j, y_dc);
- line (50 + j, 80, x_in + j, y_in);
- //foods
- if (i != 30 && m < 630) circle (m, 80, 5);
- else {
- m += 60;
- }
- if (i < 60) ++i;
- else i = 0;
- delay(20);
- if (j != 540) cleardevice();
- }
- getch();
- closegraph();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement