-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstyle2.css
More file actions
175 lines (152 loc) · 3.31 KB
/
Copy pathstyle2.css
File metadata and controls
175 lines (152 loc) · 3.31 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*parameters*/
:root{
--bulletSpeed:0.5s;
--bullet_left_start:0px;
--bullet_left_end:0px;
--bullet_top_start:0px;
--bullet_top_end:0px;
--egg_left_start:0px;
--egg_left_end:0px;
--egg_top_start:0px;
--egg_top_end:0px;
}
/*all the objects*/
#score {
text-align:center;
top: 300px;
left: 300px;
position: absolute;
}
#game{
width: 600px;
height: 300px;
border: 2px solid black;
margin: auto;
background-image:url("./img/34d7a3bbe7ab056f213e66c7182dd57e.gif") ;
background-size: cover;
}
#shooter{
height: 75px;/*75+225=300*/
width: 75px;
top: 235px; /*the distance from top*/
position: absolute;
background-image: url("./img/shooting.png");
background-size: cover;
/*animation: jump 0.5s infinite;*/
}
#bullet{
width: 35px;
height:35px;
position: absolute;
top:235px;
left:100px;
background-image: url(./img/bullet.png);
background-size: cover;
visibility: hidden;
/*animation:bullet 1s infinite;*/
}
#egg{
height: 75px;/*75+225=300*/
width: 75px;
top: 235px; /*the distance from top*/
left:520px;
position: absolute;
background-image:url(./img/egg.png);
background-size: cover;
}
#egg-bullet{
width: 35px;
height:35px;
position: absolute;
top:235px;
left:400px;
background-image: url(./img/egg-bullet.png);
background-size: cover;
visibility: hidden;
/*animation:bullet 1s infinite;*/
}
#heart1{
width: 35px;
height:35px;
position: absolute;
top:325px;
left:400px;
background-image: url(./img/heart.png);
background-size: cover;
visibility: visible;
/*animation:bullet 1s infinite;*/
}
#heart2{
width: 35px;
height:35px;
position: absolute;
top:325px;
left:440px;
background-image: url(./img/heart.png);
background-size: cover;
visibility: visible;
/*animation:bullet 1s infinite;*/
}
#heart3{
width: 35px;
height:35px;
position: absolute;
top:325px;
left:480px;
background-image: url(./img/heart.png);
background-size: cover;
visibility: visible;
/*animation:bullet 1s infinite;*/
}
/*****all the animation and class*****/
/*move&jump&shoot animation for shooter*/
.jump-animation{
animation:jump 0.5s;
}
@keyframes jump{
0%{top: 235px;}
50%{top: 100px;}
75%{top: 100px;}
100%{top: 235px;}
}
/*shoot animation for bullet and egg-bullet*/
.shoot-animation{
animation: shoot var(--bulletSpeed);
/*visibility: visible;*/
}
@keyframes shoot{
0%{
left: var(--bullet_left_start);
top: var(--bullet_top_start);
visibility: visible;
}
100%{
left: var(--bullet_left_end);
top:var(--bullet_top_end);
visibility: hidden;
}
}
.egg-shoot-animation{
animation:egg-shoot var(--bulletSpeed);
}
@keyframes egg-shoot{
0%{
left: var(--egg_left_start);
top: var(--egg_top_start);
visibility: visible;
}
100%{
left: var(--egg_left_end);
top:var(--egg_top_end);
visibility: hidden;
}
}
/*egg break animation*/
.egg-break{
animation:break 1s;
}
@keyframes break{
0%{background-image: url(./img/egg.png);}
50%{background-image: url(./img/broke_egg.png);}
100%{background-image: url(./img/egg.png);}
}