File size: 4,760 Bytes
7108ed1
 
 
72fdffd
7108ed1
027d715
 
 
7108ed1
 
72fdffd
027d715
7108ed1
 
 
 
 
 
 
72fdffd
 
7108ed1
 
 
 
 
 
 
 
 
 
027d715
 
fcc2dcd
7108ed1
 
 
 
 
fcc2dcd
 
72fdffd
027d715
 
7108ed1
 
fcc2dcd
7108ed1
 
 
 
027d715
7108ed1
fcc2dcd
124caa5
 
 
 
 
 
 
7108ed1
 
 
 
 
 
 
 
124caa5
 
7108ed1
 
 
 
124caa5
 
 
 
 
 
7108ed1
 
72fdffd
124caa5
 
 
 
 
 
 
027d715
 
fcc2dcd
 
 
7108ed1
 
 
fcc2dcd
7108ed1
72fdffd
7108ed1
 
 
 
027d715
 
 
 
 
 
7108ed1
027d715
 
 
 
 
7108ed1
027d715
7108ed1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
027d715
 
7108ed1
 
 
 
027d715
 
7108ed1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    font-family: 'Press Start 2P', cursive;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    background-attachment: fixed;
}
.game-container {
    border: 4px solid #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    background-image: url('http://static.photos/space/1024x576/42');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}
#player {
    transition: left 0.1s ease-out;
    background-image: url('https://opengameart.org/sites/default/files/spaceship_0.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 10px rgba(66, 135, 245, 0.8));
    transform: rotate(90deg);
}
.enemy {
    position: absolute;
    width: 48px;
    height: 48px;
    background-image: url('https://opengameart.org/sites/default/files/enemyShip_0.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 10px rgba(235, 72, 72, 0.8));
    transition: transform 0.1s ease-out;
    animation: pulse 1s infinite alternate, float 3s infinite ease-in-out;
    transform: rotate(-90deg);
}
@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}
.power-up {
    position: absolute;
    width: 32px;
    height: 32px;
    background-image: url('http://static.photos/yellow/32x32/4');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    animation: float 2s infinite ease-in-out, spin 4s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
#lives-container {
    display: flex;
    gap: 10px;
    font-size: 28px;
}
#lives-container span {
    transition: transform 0.2s;
}

#lives-container span:hover {
    transform: scale(1.2);
}
.bullet {
    position: absolute;
    width: 16px;
    height: 32px;
    background-image: url('https://opengameart.org/sites/default/files/laserBlue16.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 5px rgba(66, 135, 245, 0.8));
    animation: glow 0.5s infinite alternate;
}
@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.8)); }
    to { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 1)); }
}
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #f59e0b;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
    background-image: url('http://static.photos/black/1024x576/5');
    background-size: cover;
}

.game-over h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #ff4d4d;
    text-shadow: 0 0 15px rgba(255, 77, 77, 0.8);
}

.game-over button {
    background: linear-gradient(to right, #f59e0b, #ff4d4d);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.game-over button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
}
.hidden {
    display: none;
}

/* Starfield animation */
.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 3s infinite alternate;
    opacity: 0.7;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* New stats styling */
.stats > div {
    background: rgba(31, 41, 55, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stats > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.controls button {
    border: 2px solid #f59e0b;
    transition: all 0.2s ease;
}

.controls button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}