-
Notifications
You must be signed in to change notification settings - Fork 1
/
hard.cpp
92 lines (88 loc) · 2.62 KB
/
hard.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include "hard.hpp"
Hard::Hard(int x) : Flying_Object({9, 321, 33, 61}, {x, 0, 40, 40}) {}
void Hard::fly()
{
// Sprite will flap it wings
if (!exploded)
{
switch (frame)
{
case 0:
srcRect = {11, 422, 33, 61}; //coordinates with the respective frame
frame = 1;
break;
case 1:
srcRect = {61, 423, 33, 61}; //coordinates with the respective frame
frame = 2;
break;
case 2:
srcRect = {112, 427, 32, 56}; //coordinates with the respective frame
frame = 3;
break;
case 3:
srcRect = {163, 428, 33, 51}; //coordinates with the respective frame
frame = 4;
break;
case 4:
srcRect = {214, 429, 33, 48}; //coordinates with the respective frame
frame = 5;
break;
case 5:
srcRect = {265, 429, 33, 48}; //coordinates with the respective frame
frame = 6;
break;
case 6:
srcRect = {316, 429, 34, 48}; //coordinates with the respective frame
frame = 7;
break;
case 7:
srcRect = {365, 428, 37, 49}; //coordinates with the respective frame
frame = 8;
break;
case 8:
srcRect = {413, 427, 39, 51}; //coordinates with the respective frame
frame = 0;
break;
}
moverRect.y += 20;
}
else
{
switch (frame)
{
case 0:
srcRect = {41, 880, 92, 95}; //coordinates with the respective frame
frame = 1;
break;
case 1:
srcRect = {191, 859, 133, 141}; //coordinates with the respective frame
frame = 2;
break;
case 2:
srcRect = {341, 848, 162, 165}; //coordinates with the respective frame
frame = 3;
break;
case 3:
srcRect = {508, 848, 162, 165}; //coordinates with the respective frame
frame = 4;
break;
case 4:
srcRect = {683, 848, 154, 165}; //coordinates with the respective frame
frame = 5;
break;
case 5:
srcRect = {849, 848, 154, 165}; //coordinates with the respective frame
frame = 6;
break;
case 6:
srcRect = {1012, 848, 158, 165}; //coordinates with the respective frame
// frame = 7;
end = true;
break;
}
}
}
void Hard::removeHard() //removing bullets
{
moverRect = {0, 0, 0, 0};
}