Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +510 -19
- prompts.txt +3 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: neon-pong-defender
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: gray
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,510 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="pt-BR">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Neon Pong Defender</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<style>
|
9 |
+
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
10 |
+
|
11 |
+
body {
|
12 |
+
font-family: 'Orbitron', sans-serif;
|
13 |
+
background-color: #0f0f1a;
|
14 |
+
overflow: hidden;
|
15 |
+
margin: 0;
|
16 |
+
padding: 0;
|
17 |
+
cursor: none;
|
18 |
+
}
|
19 |
+
|
20 |
+
.game-container {
|
21 |
+
position: relative;
|
22 |
+
width: 800px;
|
23 |
+
height: 600px;
|
24 |
+
margin: 20px auto;
|
25 |
+
border: 3px solid #4f46e5;
|
26 |
+
border-radius: 8px;
|
27 |
+
box-shadow: 0 0 20px #4f46e5, inset 0 0 20px rgba(79, 70, 229, 0.3);
|
28 |
+
overflow: hidden;
|
29 |
+
}
|
30 |
+
|
31 |
+
.ball {
|
32 |
+
position: absolute;
|
33 |
+
width: 20px;
|
34 |
+
height: 20px;
|
35 |
+
border-radius: 50%;
|
36 |
+
background: linear-gradient(145deg, #00ff9d, #00b8ff);
|
37 |
+
box-shadow: 0 0 10px #00ff9d, 0 0 20px #00b8ff;
|
38 |
+
transition: all 0.3s;
|
39 |
+
}
|
40 |
+
|
41 |
+
.paddle {
|
42 |
+
position: absolute;
|
43 |
+
width: 160px;
|
44 |
+
height: 15px;
|
45 |
+
bottom: 10px;
|
46 |
+
border-radius: 10px;
|
47 |
+
background: linear-gradient(145deg, #ff00aa, #ff0066);
|
48 |
+
box-shadow: 0 0 10px #ff00aa, 0 0 20px rgba(255, 0, 170, 0.5);
|
49 |
+
}
|
50 |
+
|
51 |
+
.score {
|
52 |
+
color: #00ff9d;
|
53 |
+
text-shadow: 0 0 5px #00ff9d;
|
54 |
+
font-size: 24px;
|
55 |
+
}
|
56 |
+
|
57 |
+
.timer {
|
58 |
+
color: #00b8ff;
|
59 |
+
text-shadow: 0 0 5px #00b8ff;
|
60 |
+
font-size: 24px;
|
61 |
+
}
|
62 |
+
|
63 |
+
.pulse {
|
64 |
+
animation: pulse 0.5s ease-out;
|
65 |
+
}
|
66 |
+
|
67 |
+
@keyframes pulse {
|
68 |
+
0% { transform: scale(1); }
|
69 |
+
50% { transform: scale(1.3); }
|
70 |
+
100% { transform: scale(1); }
|
71 |
+
}
|
72 |
+
|
73 |
+
.explode {
|
74 |
+
animation: explode 0.5s ease-out;
|
75 |
+
}
|
76 |
+
|
77 |
+
@keyframes explode {
|
78 |
+
0% { transform: scale(1); opacity: 1; }
|
79 |
+
100% { transform: scale(3); opacity: 0; }
|
80 |
+
}
|
81 |
+
|
82 |
+
.grid-lines {
|
83 |
+
position: absolute;
|
84 |
+
top: 0;
|
85 |
+
left: 0;
|
86 |
+
width: 100%;
|
87 |
+
height: 100%;
|
88 |
+
background:
|
89 |
+
linear-gradient(to right, rgba(79, 70, 229, 0.1) 1px, transparent 1px),
|
90 |
+
linear-gradient(to bottom, rgba(79, 70, 229, 0.1) 1px, transparent 1px);
|
91 |
+
background-size: 20px 20px;
|
92 |
+
pointer-events: none;
|
93 |
+
}
|
94 |
+
|
95 |
+
.game-over {
|
96 |
+
position: absolute;
|
97 |
+
top: 0;
|
98 |
+
left: 0;
|
99 |
+
width: 100%;
|
100 |
+
height: 100%;
|
101 |
+
background-color: rgba(15, 15, 26, 0.8);
|
102 |
+
display: flex;
|
103 |
+
flex-direction: column;
|
104 |
+
justify-content: center;
|
105 |
+
align-items: center;
|
106 |
+
z-index: 100;
|
107 |
+
color: #ff0066;
|
108 |
+
font-size: 48px;
|
109 |
+
text-shadow: 0 0 10px #ff0066;
|
110 |
+
display: none;
|
111 |
+
}
|
112 |
+
|
113 |
+
.restart-btn {
|
114 |
+
margin-top: 20px;
|
115 |
+
padding: 10px 30px;
|
116 |
+
background: linear-gradient(145deg, #4f46e5, #7c3aed);
|
117 |
+
border: none;
|
118 |
+
border-radius: 5px;
|
119 |
+
color: white;
|
120 |
+
font-family: 'Orbitron', sans-serif;
|
121 |
+
font-size: 20px;
|
122 |
+
cursor: pointer;
|
123 |
+
box-shadow: 0 0 10px #4f46e5;
|
124 |
+
transition: all 0.3s;
|
125 |
+
}
|
126 |
+
|
127 |
+
.restart-btn:hover {
|
128 |
+
transform: scale(1.05);
|
129 |
+
box-shadow: 0 0 20px #4f46e5;
|
130 |
+
}
|
131 |
+
|
132 |
+
.speed-indicator {
|
133 |
+
position: absolute;
|
134 |
+
top: 10px;
|
135 |
+
right: 10px;
|
136 |
+
color: #00b8ff;
|
137 |
+
font-size: 16px;
|
138 |
+
text-shadow: 0 0 5px #00b8ff;
|
139 |
+
}
|
140 |
+
|
141 |
+
.particle {
|
142 |
+
position: absolute;
|
143 |
+
width: 5px;
|
144 |
+
height: 5px;
|
145 |
+
border-radius: 50%;
|
146 |
+
background-color: #00ff9d;
|
147 |
+
pointer-events: none;
|
148 |
+
}
|
149 |
+
|
150 |
+
.custom-cursor {
|
151 |
+
position: absolute;
|
152 |
+
width: 20px;
|
153 |
+
height: 20px;
|
154 |
+
border-radius: 50%;
|
155 |
+
background-color: rgba(255, 255, 255, 0.5);
|
156 |
+
pointer-events: none;
|
157 |
+
z-index: 1000;
|
158 |
+
mix-blend-mode: difference;
|
159 |
+
display: none;
|
160 |
+
}
|
161 |
+
|
162 |
+
.controls-info {
|
163 |
+
position: absolute;
|
164 |
+
bottom: 40px;
|
165 |
+
left: 10px;
|
166 |
+
color: #4f46e5;
|
167 |
+
font-size: 12px;
|
168 |
+
text-shadow: 0 0 5px #4f46e5;
|
169 |
+
}
|
170 |
+
|
171 |
+
.instructions {
|
172 |
+
position: absolute;
|
173 |
+
top: 40px;
|
174 |
+
left: 10px;
|
175 |
+
color: #4f46e5;
|
176 |
+
font-size: 12px;
|
177 |
+
text-shadow: 0 0 5px #4f46e5;
|
178 |
+
background-color: rgba(15, 15, 26, 0.7);
|
179 |
+
padding: 10px;
|
180 |
+
border-radius: 5px;
|
181 |
+
max-width: 200px;
|
182 |
+
}
|
183 |
+
</style>
|
184 |
+
</head>
|
185 |
+
<body class="flex flex-col items-center justify-center min-h-screen">
|
186 |
+
<h1 class="text-4xl font-bold mb-4 text-transparent bg-clip-text bg-gradient-to-r from-purple-500 to-pink-500">NEON PONG DEFENDER</h1>
|
187 |
+
|
188 |
+
<div class="flex justify-between w-96 mb-4">
|
189 |
+
<div class="score">PONTOS: <span id="player-score">0</span></div>
|
190 |
+
<div class="timer">TEMPO: <span id="game-timer">00:00</span></div>
|
191 |
+
</div>
|
192 |
+
|
193 |
+
<div class="game-container" id="game-container">
|
194 |
+
<div class="grid-lines"></div>
|
195 |
+
<div class="speed-indicator">VELOCIDADE: <span id="speed-level">1x</span></div>
|
196 |
+
<div class="ball" id="ball"></div>
|
197 |
+
<div class="paddle" id="paddle"></div>
|
198 |
+
<div class="game-over" id="game-over">
|
199 |
+
FIM DE JOGO
|
200 |
+
<button class="restart-btn" id="restart-btn">JOGAR NOVAMENTE</button>
|
201 |
+
</div>
|
202 |
+
<div class="controls-info">CONTROLES: Teclas de seta ou mouse</div>
|
203 |
+
<div class="instructions">
|
204 |
+
<p><strong>COMO JOGAR:</strong></p>
|
205 |
+
<p>- Use as teclas ← → ou o mouse para mover a raquete</p>
|
206 |
+
<p>- Impedir que a bola caia</p>
|
207 |
+
<p>- Cada rebatida marca 1 ponto</p>
|
208 |
+
<p>- A velocidade aumenta a cada minuto</p>
|
209 |
+
</div>
|
210 |
+
</div>
|
211 |
+
|
212 |
+
<div class="mt-4 text-purple-400 text-center">
|
213 |
+
<p>Defenda a bola com sua raquete e marque o máximo de pontos!</p>
|
214 |
+
<p class="text-sm text-purple-600">O jogo fica mais rápido a cada minuto!</p>
|
215 |
+
</div>
|
216 |
+
|
217 |
+
<div class="custom-cursor" id="custom-cursor"></div>
|
218 |
+
|
219 |
+
<script>
|
220 |
+
document.addEventListener('DOMContentLoaded', () => {
|
221 |
+
const gameContainer = document.getElementById('game-container');
|
222 |
+
const ball = document.getElementById('ball');
|
223 |
+
const paddle = document.getElementById('paddle');
|
224 |
+
const playerScoreElement = document.getElementById('player-score');
|
225 |
+
const gameTimerElement = document.getElementById('game-timer');
|
226 |
+
const gameOverScreen = document.getElementById('game-over');
|
227 |
+
const restartBtn = document.getElementById('restart-btn');
|
228 |
+
const speedLevelElement = document.getElementById('speed-level');
|
229 |
+
const customCursor = document.getElementById('custom-cursor');
|
230 |
+
|
231 |
+
const containerWidth = gameContainer.offsetWidth;
|
232 |
+
const containerHeight = gameContainer.offsetHeight;
|
233 |
+
const paddleWidth = containerWidth / 5;
|
234 |
+
|
235 |
+
let ballX = containerWidth / 2;
|
236 |
+
let ballY = 50;
|
237 |
+
let ballSpeedX = 3;
|
238 |
+
let ballSpeedY = 3;
|
239 |
+
let paddleX = (containerWidth - paddleWidth) / 2;
|
240 |
+
let playerScore = 0;
|
241 |
+
let gameTime = 0;
|
242 |
+
let gameSpeed = 1;
|
243 |
+
let gameRunning = true;
|
244 |
+
let animationId;
|
245 |
+
let mouseX = 0;
|
246 |
+
let useMouse = false;
|
247 |
+
|
248 |
+
// Cores aleatórias para a bola
|
249 |
+
const ballColors = [
|
250 |
+
{gradient: 'linear-gradient(145deg, #00ff9d, #00b8ff)', shadow1: '#00ff9d', shadow2: '#00b8ff'},
|
251 |
+
{gradient: 'linear-gradient(145deg, #ff9d00, #ff00b8)', shadow1: '#ff9d00', shadow2: '#ff00b8'},
|
252 |
+
{gradient: 'linear-gradient(145deg, #9d00ff, #00b8ff)', shadow1: '#9d00ff', shadow2: '#00b8ff'},
|
253 |
+
{gradient: 'linear-gradient(145deg, #ff0066, #ffcc00)', shadow1: '#ff0066', shadow2: '#ffcc00'},
|
254 |
+
{gradient: 'linear-gradient(145deg, #00ff66, #6600ff)', shadow1: '#00ff66', shadow2: '#6600ff'}
|
255 |
+
];
|
256 |
+
|
257 |
+
// Set initial paddle size
|
258 |
+
paddle.style.width = `${paddleWidth}px`;
|
259 |
+
|
260 |
+
// Mouse movement tracking
|
261 |
+
gameContainer.addEventListener('mousemove', (e) => {
|
262 |
+
const rect = gameContainer.getBoundingClientRect();
|
263 |
+
mouseX = e.clientX - rect.left - paddleWidth / 2;
|
264 |
+
useMouse = true;
|
265 |
+
|
266 |
+
// Update custom cursor position
|
267 |
+
customCursor.style.display = 'block';
|
268 |
+
customCursor.style.left = `${e.clientX - 10}px`;
|
269 |
+
customCursor.style.top = `${e.clientY - 10}px`;
|
270 |
+
});
|
271 |
+
|
272 |
+
gameContainer.addEventListener('mouseleave', () => {
|
273 |
+
useMouse = false;
|
274 |
+
customCursor.style.display = 'none';
|
275 |
+
});
|
276 |
+
|
277 |
+
// Keyboard controls
|
278 |
+
const keys = {
|
279 |
+
ArrowLeft: false,
|
280 |
+
ArrowRight: false
|
281 |
+
};
|
282 |
+
|
283 |
+
document.addEventListener('keydown', (e) => {
|
284 |
+
if (e.key in keys) {
|
285 |
+
keys[e.key] = true;
|
286 |
+
useMouse = false;
|
287 |
+
customCursor.style.display = 'none';
|
288 |
+
}
|
289 |
+
});
|
290 |
+
|
291 |
+
document.addEventListener('keyup', (e) => {
|
292 |
+
if (e.key in keys) {
|
293 |
+
keys[e.key] = false;
|
294 |
+
}
|
295 |
+
});
|
296 |
+
|
297 |
+
restartBtn.addEventListener('click', resetGame);
|
298 |
+
|
299 |
+
function updatePaddlePosition() {
|
300 |
+
if (useMouse) {
|
301 |
+
// Mouse control
|
302 |
+
paddleX = Math.max(0, Math.min(mouseX, containerWidth - paddleWidth));
|
303 |
+
} else {
|
304 |
+
// Keyboard control
|
305 |
+
if (keys.ArrowLeft && paddleX > 0) {
|
306 |
+
paddleX -= 8 * gameSpeed;
|
307 |
+
}
|
308 |
+
if (keys.ArrowRight && paddleX < containerWidth - paddleWidth) {
|
309 |
+
paddleX += 8 * gameSpeed;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
paddle.style.left = `${paddleX}px`;
|
314 |
+
}
|
315 |
+
|
316 |
+
function updateBallPosition() {
|
317 |
+
ballX += ballSpeedX * gameSpeed;
|
318 |
+
ballY += ballSpeedY * gameSpeed;
|
319 |
+
|
320 |
+
// Ball collision with walls
|
321 |
+
if (ballX <= 0) {
|
322 |
+
ballX = 0;
|
323 |
+
ballSpeedX = -ballSpeedX;
|
324 |
+
createParticles(ballX, ballY, 5);
|
325 |
+
}
|
326 |
+
|
327 |
+
if (ballX >= containerWidth - 20) {
|
328 |
+
ballX = containerWidth - 20;
|
329 |
+
ballSpeedX = -ballSpeedX;
|
330 |
+
createParticles(ballX, ballY, 5);
|
331 |
+
}
|
332 |
+
|
333 |
+
// Ball collision with ceiling
|
334 |
+
if (ballY <= 0) {
|
335 |
+
ballY = 0;
|
336 |
+
ballSpeedY = -ballSpeedY;
|
337 |
+
createParticles(ballX, ballY, 5);
|
338 |
+
}
|
339 |
+
|
340 |
+
// Ball collision with paddle
|
341 |
+
if (
|
342 |
+
ballY >= containerHeight - 35 &&
|
343 |
+
ballY <= containerHeight - 20 &&
|
344 |
+
ballX >= paddleX &&
|
345 |
+
ballX <= paddleX + paddleWidth
|
346 |
+
) {
|
347 |
+
ballSpeedY = -ballSpeedY;
|
348 |
+
|
349 |
+
// Add some randomness to the bounce
|
350 |
+
const hitPosition = (ballX - paddleX) / paddleWidth;
|
351 |
+
ballSpeedX = (hitPosition - 0.5) * 8;
|
352 |
+
|
353 |
+
playerScore++;
|
354 |
+
playerScoreElement.textContent = playerScore;
|
355 |
+
|
356 |
+
// Paddle hit effect
|
357 |
+
paddle.classList.add('pulse');
|
358 |
+
setTimeout(() => paddle.classList.remove('pulse'), 500);
|
359 |
+
|
360 |
+
// Explode current ball and create new one
|
361 |
+
ball.classList.add('explode');
|
362 |
+
createParticles(ballX, ballY, 20, '#ff00aa');
|
363 |
+
|
364 |
+
// Create new ball with random color
|
365 |
+
setTimeout(() => {
|
366 |
+
ball.classList.remove('explode');
|
367 |
+
const randomColor = ballColors[Math.floor(Math.random() * ballColors.length)];
|
368 |
+
ball.style.background = randomColor.gradient;
|
369 |
+
ball.style.boxShadow = `0 0 10px ${randomColor.shadow1}, 0 0 20px ${randomColor.shadow2}`;
|
370 |
+
|
371 |
+
ballX = containerWidth / 2;
|
372 |
+
ballY = 50;
|
373 |
+
ballSpeedX = (Math.random() > 0.5 ? 3 : -3) * gameSpeed;
|
374 |
+
ballSpeedY = 3 * gameSpeed;
|
375 |
+
}, 500);
|
376 |
+
}
|
377 |
+
|
378 |
+
// Ball out of bounds (game over)
|
379 |
+
if (ballY >= containerHeight) {
|
380 |
+
gameOver();
|
381 |
+
|
382 |
+
// Explosion effect
|
383 |
+
ball.classList.add('explode');
|
384 |
+
createParticles(ballX, ballY, 20, '#ff0066');
|
385 |
+
}
|
386 |
+
|
387 |
+
ball.style.left = `${ballX}px`;
|
388 |
+
ball.style.top = `${ballY}px`;
|
389 |
+
}
|
390 |
+
|
391 |
+
function createParticles(x, y, count, color = '#00ff9d') {
|
392 |
+
for (let i = 0; i < count; i++) {
|
393 |
+
const particle = document.createElement('div');
|
394 |
+
particle.className = 'particle';
|
395 |
+
particle.style.left = `${x}px`;
|
396 |
+
particle.style.top = `${y}px`;
|
397 |
+
particle.style.backgroundColor = color;
|
398 |
+
gameContainer.appendChild(particle);
|
399 |
+
|
400 |
+
const angle = Math.random() * Math.PI * 2;
|
401 |
+
const speed = 1 + Math.random() * 3;
|
402 |
+
const lifetime = 500 + Math.random() * 500;
|
403 |
+
|
404 |
+
const particleSpeedX = Math.cos(angle) * speed;
|
405 |
+
const particleSpeedY = Math.sin(angle) * speed;
|
406 |
+
|
407 |
+
let particleX = x;
|
408 |
+
let particleY = y;
|
409 |
+
|
410 |
+
const animateParticle = () => {
|
411 |
+
particleX += particleSpeedX;
|
412 |
+
particleY += particleSpeedY;
|
413 |
+
particle.style.opacity = parseFloat(particle.style.opacity || 1) - 0.01;
|
414 |
+
|
415 |
+
particle.style.left = `${particleX}px`;
|
416 |
+
particle.style.top = `${particleY}px`;
|
417 |
+
|
418 |
+
if (parseFloat(particle.style.opacity || 1) > 0) {
|
419 |
+
requestAnimationFrame(animateParticle);
|
420 |
+
} else {
|
421 |
+
particle.remove();
|
422 |
+
}
|
423 |
+
};
|
424 |
+
|
425 |
+
setTimeout(() => {
|
426 |
+
animateParticle();
|
427 |
+
}, 10);
|
428 |
+
|
429 |
+
setTimeout(() => {
|
430 |
+
particle.remove();
|
431 |
+
}, lifetime);
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
function updateTimer() {
|
436 |
+
gameTime++;
|
437 |
+
|
438 |
+
const minutes = Math.floor(gameTime / 60).toString().padStart(2, '0');
|
439 |
+
const seconds = (gameTime % 60).toString().padStart(2, '0');
|
440 |
+
gameTimerElement.textContent = `${minutes}:${seconds}`;
|
441 |
+
|
442 |
+
// Increase game speed every minute
|
443 |
+
if (gameTime % 60 === 0) {
|
444 |
+
gameSpeed += 0.25;
|
445 |
+
speedLevelElement.textContent = `${gameSpeed.toFixed(2)}x`;
|
446 |
+
|
447 |
+
// Speed increase effect
|
448 |
+
gameContainer.style.boxShadow = `0 0 30px #4f46e5, inset 0 0 30px rgba(79, 70, 229, 0.5)`;
|
449 |
+
setTimeout(() => {
|
450 |
+
gameContainer.style.boxShadow = `0 0 20px #4f46e5, inset 0 0 20px rgba(79, 70, 229, 0.3)`;
|
451 |
+
}, 500);
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
function gameOver() {
|
456 |
+
gameRunning = false;
|
457 |
+
gameOverScreen.style.display = 'flex';
|
458 |
+
cancelAnimationFrame(animationId);
|
459 |
+
}
|
460 |
+
|
461 |
+
function resetGame() {
|
462 |
+
ballX = containerWidth / 2;
|
463 |
+
ballY = 50;
|
464 |
+
ballSpeedX = 3;
|
465 |
+
ballSpeedY = 3;
|
466 |
+
paddleX = (containerWidth - paddleWidth) / 2;
|
467 |
+
playerScore = 0;
|
468 |
+
gameTime = 0;
|
469 |
+
gameSpeed = 1;
|
470 |
+
|
471 |
+
// Reset ball color
|
472 |
+
ball.style.background = 'linear-gradient(145deg, #00ff9d, #00b8ff)';
|
473 |
+
ball.style.boxShadow = '0 0 10px #00ff9d, 0 0 20px #00b8ff';
|
474 |
+
|
475 |
+
playerScoreElement.textContent = '0';
|
476 |
+
gameTimerElement.textContent = '00:00';
|
477 |
+
speedLevelElement.textContent = '1x';
|
478 |
+
|
479 |
+
ball.classList.remove('explode');
|
480 |
+
gameOverScreen.style.display = 'none';
|
481 |
+
gameRunning = true;
|
482 |
+
|
483 |
+
// Remove all particles
|
484 |
+
document.querySelectorAll('.particle').forEach(p => p.remove());
|
485 |
+
|
486 |
+
gameLoop();
|
487 |
+
}
|
488 |
+
|
489 |
+
function gameLoop() {
|
490 |
+
if (!gameRunning) return;
|
491 |
+
|
492 |
+
updatePaddlePosition();
|
493 |
+
updateBallPosition();
|
494 |
+
|
495 |
+
animationId = requestAnimationFrame(gameLoop);
|
496 |
+
}
|
497 |
+
|
498 |
+
// Start the game
|
499 |
+
resetGame();
|
500 |
+
|
501 |
+
// Start timer
|
502 |
+
setInterval(() => {
|
503 |
+
if (gameRunning) {
|
504 |
+
updateTimer();
|
505 |
+
}
|
506 |
+
}, 1000);
|
507 |
+
});
|
508 |
+
</script>
|
509 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=gallabs/neon-pong-defender" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
510 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
Crie um jogo onde tem uma bola do tipo de ping pong, que vai caindo do céu e o jogador não pode deixar tocar na base. Use as setas do teclado para movimentar a plataforma, como de fosse uma raquete, cm o tamanho de mais ou menos 1/5 da largura da base. Crie um contador para o usuário e para o PC, um timer, que acelera o jogo a cada 1 minuto jogado. Crie um efeito especial quando a bolinha bater na raquete e um outro efeito quando a bolinha tocar na base. Use um layout futurista, com um pouco de neon e use sua criatividade para melhorar / criar outras features.
|
2 |
+
A plataforma para tentar atacar a bola tem de estar na base. Está no topo. Acrescente a opção de controlar a plataforma / raquete com o mouse, também.
|
3 |
+
Está quase perfeito, mas a bolinha não pode sair da área do jogo. Quando o jogador marcar ponto a bolinha explode e surge outra de outra cor, aleatória, descendo do topo. Para ficar perfeito, ponhas as intruções e legendas na tela do game todas em português do Brasil.
|