-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_visual_effects.html
More file actions
234 lines (204 loc) · 8.26 KB
/
test_visual_effects.html
File metadata and controls
234 lines (204 loc) · 8.26 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Visual Effects Test - Pac-Mind</title>
<link rel="stylesheet" href="styles.css">
<style>
.test-controls {
position: fixed;
top: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.8);
padding: 20px;
border: 2px solid var(--neon-green);
border-radius: 10px;
color: var(--neon-green);
font-family: 'Press Start 2P', monospace;
font-size: 0.7rem;
z-index: 1000;
}
.test-controls h3 {
margin: 0 0 15px 0;
color: var(--neon-yellow);
text-align: center;
}
.test-controls button {
display: block;
width: 100%;
margin: 8px 0;
padding: 8px 12px;
background: rgba(0, 255, 0, 0.1);
border: 1px solid var(--neon-green);
color: var(--neon-green);
font-family: 'Press Start 2P', monospace;
font-size: 0.6rem;
cursor: pointer;
transition: all 0.2s ease;
}
.test-controls button:hover {
background: rgba(0, 255, 0, 0.2);
box-shadow: 0 0 10px var(--neon-green);
}
.performance-info {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid var(--neon-cyan);
font-size: 0.5rem;
color: var(--neon-cyan);
}
</style>
</head>
<body>
<div class="game-container">
<div class="crt-screen">
<div class="game-header">
<h1 class="game-title">PAC-MIND</h1>
<div class="score-display">
<span class="score-label">SCORE</span>
<span class="score-value" id="score">000000</span>
</div>
<div class="lives-display">
<span class="lives-label">LIVES</span>
<span class="lives-value" id="lives">3</span>
</div>
</div>
<canvas id="gameCanvas" width="800" height="600"></canvas>
<div class="game-footer">
<div class="level-display">
<span class="level-label">LEVEL</span>
<span class="level-value" id="level">1</span>
</div>
<div class="power-indicator" id="powerIndicator">
<span class="power-text">POWER MODE</span>
</div>
</div>
</div>
<div class="ghost-brain-panel">
<h2 class="panel-title">GHOST BRAIN</h2>
<div class="ghost-status" id="ghostStatus">
<div class="ghost-info" data-ghost="red">
<div class="ghost-color red"></div>
<div class="ghost-state">SCATTER</div>
<div class="ghost-explanation">Patrolling corner area</div>
</div>
<div class="ghost-info" data-ghost="pink">
<div class="ghost-color pink"></div>
<div class="ghost-state">SCATTER</div>
<div class="ghost-explanation">Patrolling corner area</div>
</div>
<div class="ghost-info" data-ghost="cyan">
<div class="ghost-color cyan"></div>
<div class="ghost-state">SCATTER</div>
<div class="ghost-explanation">Patrolling corner area</div>
</div>
<div class="ghost-info" data-ghost="orange">
<div class="ghost-color orange"></div>
<div class="ghost-state">SCATTER</div>
<div class="ghost-explanation">Patrolling corner area</div>
</div>
</div>
</div>
</div>
<div class="test-controls">
<h3>EFFECT TESTS</h3>
<button onclick="testGlitch()">GLITCH EFFECT</button>
<button onclick="testScreenTear()">SCREEN TEAR</button>
<button onclick="testPowerSurge()">POWER SURGE</button>
<button onclick="testStaticNoise()">STATIC NOISE</button>
<button onclick="testGhostCollision()">GHOST COLLISION</button>
<button onclick="testPowerPellet()">POWER PELLET</button>
<button onclick="testLevelComplete()">LEVEL COMPLETE</button>
<button onclick="testGameOver()">GAME OVER</button>
<button onclick="testScoreIncrease()">SCORE INCREASE</button>
<button onclick="testHolographic()">HOLOGRAPHIC TITLE</button>
<button onclick="toggleBorderCycle()">BORDER CYCLE</button>
<div class="performance-info">
<div>Performance Mode: <span id="perfMode">-</span></div>
<div>Effect Intensity: <span id="effectIntensity">-</span></div>
</div>
</div>
<script src="js/visualEffects.js"></script>
<script>
let visualEffects;
// Initialize visual effects when page loads
document.addEventListener('DOMContentLoaded', () => {
visualEffects = new VisualEffects();
// Update performance info
document.getElementById('perfMode').textContent = visualEffects.performanceMode;
document.getElementById('effectIntensity').textContent = visualEffects.effectIntensity.toFixed(1);
console.log('Visual Effects Test initialized');
console.log('Performance mode:', visualEffects.performanceMode);
console.log('Effect intensity:', visualEffects.effectIntensity);
});
// Test functions
function testGlitch() {
const title = document.querySelector('.game-title');
visualEffects.triggerGlitch(title, 'heavy');
}
function testScreenTear() {
visualEffects.triggerScreenTear(800);
}
function testPowerSurge() {
visualEffects.triggerPowerSurge(1500);
}
function testStaticNoise() {
visualEffects.triggerStaticNoise(3000);
}
function testGhostCollision() {
visualEffects.onGhostCollision();
}
function testPowerPellet() {
visualEffects.onPowerPelletConsumed();
}
function testLevelComplete() {
visualEffects.onLevelComplete();
}
function testGameOver() {
visualEffects.onGameOver();
}
function testScoreIncrease() {
const randomPoints = Math.floor(Math.random() * 2000) + 100;
visualEffects.onScoreIncrease(randomPoints);
// Animate score change
const currentScore = parseInt(document.getElementById('score').textContent) || 0;
visualEffects.animateScoreChange(currentScore + randomPoints);
}
function testHolographic() {
visualEffects.triggerHolographicTitle();
}
function toggleBorderCycle() {
const crtScreen = document.querySelector('.crt-screen');
crtScreen.classList.toggle('neon-border-cycle');
}
// Auto-demo mode
let autoDemoInterval;
function startAutoDemo() {
const effects = [
testGlitch,
testScreenTear,
testPowerSurge,
testScoreIncrease,
testHolographic
];
autoDemoInterval = setInterval(() => {
const randomEffect = effects[Math.floor(Math.random() * effects.length)];
randomEffect();
}, 3000);
}
function stopAutoDemo() {
if (autoDemoInterval) {
clearInterval(autoDemoInterval);
autoDemoInterval = null;
}
}
// Start auto demo after 5 seconds
setTimeout(startAutoDemo, 5000);
// Stop auto demo when user interacts
document.addEventListener('click', () => {
stopAutoDemo();
});
</script>
</body>
</html>