Commit 658175b4119629ad894eafcedd3a145b6ea57bae
1 parent
7165abda
Simplified variable names
Showing
1 changed file
with
26 additions
and
28 deletions
06-multiple_targets/cannon.c
@@ -14,34 +14,32 @@ struct target { | @@ -14,34 +14,32 @@ struct target { | ||
14 | 14 | ||
15 | // Draw explosion with the center at coordinates (x,y) | 15 | // Draw explosion with the center at coordinates (x,y) |
16 | void drawExplosion(int x, int y, float scaling) { | 16 | void drawExplosion(int x, int y, float scaling) { |
17 | - int x_triangle = x; | ||
18 | - int y_triangle = y; | ||
19 | - | ||
20 | - gfx_filledTriangle(x_triangle - 7 * scaling, y_triangle - 7 * scaling, | ||
21 | - x_triangle + 7 * scaling, y_triangle + 7 * scaling, | ||
22 | - x_triangle + 22 * scaling, y_triangle - 22 * scaling, RED); | ||
23 | - gfx_filledTriangle(x_triangle - 7 * scaling, y_triangle - 7 * scaling, | ||
24 | - x_triangle + 7 * scaling, y_triangle + 7 * scaling, | ||
25 | - x_triangle - 22 * scaling, y_triangle + 22 * scaling, RED); | ||
26 | - gfx_filledTriangle(x_triangle - 7 * scaling, y_triangle + 7 * scaling, | ||
27 | - x_triangle + 7 * scaling, y_triangle - 7 * scaling, | ||
28 | - x_triangle - 22 * scaling, y_triangle - 22 * scaling, RED); | ||
29 | - gfx_filledTriangle(x_triangle - 7 * scaling, y_triangle + 7 * scaling, | ||
30 | - x_triangle + 7 * scaling, y_triangle - 7 * scaling, | ||
31 | - x_triangle + 22 * scaling, y_triangle + 22 * scaling, RED); | ||
32 | - | ||
33 | - gfx_filledTriangle(x_triangle - 13 * scaling, y_triangle, | ||
34 | - x_triangle + 13 * scaling, y_triangle, x_triangle, | ||
35 | - y_triangle - 35 * scaling, RED); | ||
36 | - gfx_filledTriangle(x_triangle - 13 * scaling, y_triangle, | ||
37 | - x_triangle + 13 * scaling, y_triangle, x_triangle, | ||
38 | - y_triangle + 35 * scaling, RED); | ||
39 | - gfx_filledTriangle(x_triangle, y_triangle - 13 * scaling, x_triangle, | ||
40 | - y_triangle + 13 * scaling, x_triangle - 35 * scaling, | ||
41 | - y_triangle, RED); | ||
42 | - gfx_filledTriangle(x_triangle, y_triangle - 13 * scaling, x_triangle, | ||
43 | - y_triangle + 13 * scaling, x_triangle + 35 * scaling, | ||
44 | - y_triangle, RED); | 17 | + |
18 | + gfx_filledTriangle(x - 7 * scaling, y - 7 * scaling, | ||
19 | + x + 7 * scaling, y + 7 * scaling, | ||
20 | + x + 22 * scaling, y - 22 * scaling, RED); | ||
21 | + gfx_filledTriangle(x - 7 * scaling, y - 7 * scaling, | ||
22 | + x + 7 * scaling, y + 7 * scaling, | ||
23 | + x - 22 * scaling, y + 22 * scaling, RED); | ||
24 | + gfx_filledTriangle(x - 7 * scaling, y + 7 * scaling, | ||
25 | + x + 7 * scaling, y - 7 * scaling, | ||
26 | + x - 22 * scaling, y - 22 * scaling, RED); | ||
27 | + gfx_filledTriangle(x - 7 * scaling, y + 7 * scaling, | ||
28 | + x + 7 * scaling, y - 7 * scaling, | ||
29 | + x + 22 * scaling, y + 22 * scaling, RED); | ||
30 | + | ||
31 | + gfx_filledTriangle(x - 13 * scaling, y, | ||
32 | + x + 13 * scaling, y, x, | ||
33 | + y - 35 * scaling, RED); | ||
34 | + gfx_filledTriangle(x - 13 * scaling, y, | ||
35 | + x + 13 * scaling, y, x, | ||
36 | + y + 35 * scaling, RED); | ||
37 | + gfx_filledTriangle(x, y - 13 * scaling, x, | ||
38 | + y + 13 * scaling, x - 35 * scaling, | ||
39 | + y, RED); | ||
40 | + gfx_filledTriangle(x, y - 13 * scaling, x, | ||
41 | + y + 13 * scaling, x + 35 * scaling, | ||
42 | + y, RED); | ||
45 | } | 43 | } |
46 | 44 | ||
47 | 45 |