Canyon Run
Gemini 3.5 Flash Lite · composer

Reviews & generation details
Reviews
No human review yet. Unreviewed does not mean unsuccessful.
Generation context
Imported historical artifact. Its exact original instructions and lineage are not known.
Generation prompt · exact text unavailable
See the current prompt for reference. It may differ from the instructions used to generate this artifact.
Inspect original source 20,139 bytes · SHA-256 8dd26d5c2a95
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Canyon Runner - High-Speed Procedural Arcade Racer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/EffectComposer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/RenderPass.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/UnrealBloomPass.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/ShaderPass.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/shaders/LuminosityHighPassShader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/shaders/CopyShader.js"></script>
<style>
/* ── css: main-style ── */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
* {
box-sizing: border-box;
margin: 0;
padding: 0;
user-select: none;
}
body, html {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #05020a;
font-family: 'Orbitron', sans-serif;
color: #fff;
}
#game-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
#hud {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 30px;
}
/* Energy Bar */
#energy-container {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
width: 300px;
text-align: center;
}
#energy-label {
font-size: 12px;
letter-spacing: 3px;
color: #ff9933;
margin-bottom: 6px;
font-weight: 700;
text-shadow: 0 0 10px rgba(255, 153, 51, 0.6);
}
#energy-bar-bg {
width: 100%;
height: 12px;
background: rgba(20, 10, 30, 0.8);
border: 2px solid rgba(255, 153, 51, 0.4);
border-radius: 6px;
overflow: hidden;
box-shadow: 0 0 15px rgba(255, 120, 20, 0.3);
}
#energy-bar-fill {
width: 100%;
height: 100%;
background: linear-gradient(90deg, #ff3300, #ff9933, #ffff33);
box-shadow: 0 0 10px #ff9933;
transition: width 0.1s linear;
}
/* Score */
#score-container {
position: absolute;
top: 30px;
right: 40px;
text-align: right;
}
#score-label {
font-size: 12px;
letter-spacing: 2px;
color: #a080ff;
margin-bottom: 2px;
}
#score-value {
font-size: 38px;
font-weight: 900;
letter-spacing: 2px;
color: #ffffff;
text-shadow: 0 0 15px rgba(160, 128, 255, 0.8);
}
/* Multiplier */
#multiplier-container {
position: absolute;
top: 100px;
right: 40px;
font-size: 22px;
font-weight: 900;
color: #00ffcc;
text-shadow: 0 0 15px rgba(0, 255, 204, 0.9);
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
letter-spacing: 1px;
}
#multiplier-container.pulse {
transform: scale(1.3);
}
#multiplier-container.hidden {
opacity: 0;
transform: scale(0.8);
}
/* Speedometer */
#speed-container {
position: absolute;
bottom: 30px;
right: 40px;
text-align: right;
}
#speed-value {
font-size: 36px;
font-weight: 900;
color: #00ffff;
text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
line-height: 1;
}
#speed-unit {
font-size: 11px;
letter-spacing: 3px;
color: #00ffff;
opacity: 0.8;
margin-top: 4px;
}
/* Boost */
#boost-container {
position: absolute;
bottom: 30px;
left: 40px;
width: 150px;
}
#boost-label {
font-size: 11px;
letter-spacing: 2px;
color: #00ffaa;
margin-top: 4px;
text-shadow: 0 0 8px rgba(0, 255, 170, 0.6);
}
#boost-bar-bg {
width: 100%;
height: 8px;
background: rgba(10, 20, 20, 0.8);
border: 1px solid rgba(0, 255, 170, 0.4);
border-radius: 4px;
overflow: hidden;
}
#boost-bar-fill {
width: 0%;
height: 100%;
background: #00ffaa;
box-shadow: 0 0 10px #00ffaa;
}
/* Near Miss Flash */
#near-miss-flash {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 5;
box-shadow: inset 0 0 100px rgba(0, 255, 204, 0);
transition: box-shadow 0.1s ease-out;
}
#near-miss-flash.flash {
box-shadow: inset 0 0 150px rgba(0, 255, 204, 0.6);
}
/* Overlays */
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, rgba(15,8,30,0.85) 0%, rgba(5,2,10,0.95) 100%);
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
transition: opacity 0.3s ease;
}
.overlay.hidden {
opacity: 0;
pointer-events: none;
}
.menu-content {
text-align: center;
max-width: 550px;
padding: 40px;
background: rgba(20, 10, 35, 0.6);
border: 1px solid rgba(255, 153, 51, 0.3);
box-shadow: 0 0 40px rgba(255, 100, 0, 0.2), inset 0 0 20px rgba(150, 50, 255, 0.1);
border-radius: 12px;
backdrop-filter: blur(10px);
}
.game-title {
font-size: 42px;
font-weight: 900;
letter-spacing: 4px;
background: linear-gradient(135deg, #ff3300, #ff9933, #a080ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 10px;
text-shadow: 0 0 30px rgba(255, 100, 0, 0.5);
}
.game-subtitle {
font-size: 14px;
letter-spacing: 5px;
color: #00ffff;
margin-bottom: 30px;
opacity: 0.9;
}
.instructions {
font-size: 13px;
line-height: 1.8;
color: #cccccc;
margin-bottom: 35px;
text-align: left;
background: rgba(0, 0, 0, 0.4);
padding: 20px;
border-radius: 8px;
border-left: 3px solid #ff9933;
}
.instructions b {
color: #ff9933;
}
.arcade-btn {
background: linear-gradient(135deg, #ff3300, #ff9933);
color: #fff;
border: none;
padding: 16px 45px;
font-family: 'Orbitron', sans-serif;
font-size: 16px;
font-weight: 900;
letter-spacing: 3px;
border-radius: 6px;
cursor: pointer;
box-shadow: 0 0 20px rgba(255, 100, 0, 0.6);
transition: all 0.2s ease;
}
.arcade-btn:hover {
transform: translateY(-2px);
box-shadow: 0 0 30px rgba(255, 153, 51, 0.9);
background: linear-gradient(135deg, #ff4510, #ffaa44);
}
.arcade-btn:active {
transform: translateY(1px);
}
.stats-box {
background: rgba(0,0,0,0.5);
border: 1px solid rgba(160, 128, 255, 0.3);
border-radius: 8px;
padding: 20px;
margin-bottom: 30px;
text-align: left;
}
.stat-row {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
font-size: 15px;
letter-spacing: 1px;
color: #a080ff;
}
.stat-row span:last-child {
color: #fff;
font-weight: 700;
}
.stat-row:last-child {
margin-bottom: 0;
}
</style>
</head>
<body>
<div id="game-container"></div>
<div id="hud">
<div id="energy-container">
<div id="energy-label">ENERGY</div>
<div id="energy-bar-bg"><div id="energy-bar-fill"></div></div>
</div>
<div id="score-container">
<div id="score-label">SCORE</div>
<div id="score-value">0</div>
</div>
<div id="multiplier-container" class="hidden">
<span id="multiplier-value">2</span>x NEAR MISS!
</div>
<div id="speed-container">
<div id="speed-value">120</div>
<div id="speed-unit">KPH</div>
</div>
<div id="boost-container">
<div id="boost-bar-bg"><div id="boost-bar-fill"></div></div>
<div id="boost-label">TURBO</div>
</div>
</div>
<div id="menu-overlay" class="overlay">
<div class="menu-content">
<h1 class="game-title">CANYON RUNNER</h1>
<p class="game-subtitle">High-Speed Procedural Arcade Racer</p>
<div class="instructions">
<p><b>A / D</b> or <b>LEFT / RIGHT</b> : Bank Craft</p>
<p><b>W / S</b> or <b>UP / DOWN</b> : Pitch & Speed</p>
<p><b>SHIFT</b> : Turbo Boost</p>
<p><b>SPACE</b> : Pause</p>
<br>
<p>Collect glowing orbs for energy. Fly close to walls for Near-Miss multipliers!</p>
</div>
<button id="start-btn" class="arcade-btn">LAUNCH CRAFT</button>
</div>
</div>
<div id="gameover-overlay" class="overlay hidden">
<div class="menu-content">
<h1 class="game-title glitch" data-text="SYSTEM FAILURE">SYSTEM FAILURE</h1>
<p class="game-subtitle">CRAFT DESTROYED</p>
<div class="stats-box">
<div class="stat-row"><span>FINAL SCORE</span><span id="final-score">0</span></div>
<div class="stat-row"><span>MAX SPEED</span><span id="final-speed">0 KPH</span></div>
<div class="stat-row"><span>DISTANCE</span><span id="final-distance">0 m</span></div>
</div>
<button id="restart-btn" class="arcade-btn">RE-INITIALIZE</button>
</div>
</div>
<div id="pause-overlay" class="overlay hidden">
<div class="menu-content">
<h1 class="game-title">PAUSED</h1>
<button id="resume-btn" class="arcade-btn">RESUME</button>
</div>
</div>
<div id="near-miss-flash"></div>
<script>
'use strict';
// ── class: SoundFX ──
// Audio Synthesizer using Web Audio API
class SoundFX {
constructor() {
this.ctx = null;
this.enabled = false;
this.engineNode = null;
this.engineGain = null;
}
init() {
if (this.ctx) return;
try {
const AudioContext = window.AudioContext || window.webkitAudioContext;
this.ctx = new AudioContext();
this.enabled = true;
this.startEngineHum();
} catch(e) {
console.warn("Web Audio API not supported", e);
}
}
startEngineHum() {
if (!this.enabled || !this.ctx) return;
try {
this.engineNode = this.ctx.createOscillator();
this.engineNode.type = 'sawtooth';
this.engineNode.frequency.setValueAtTime(60, this.ctx.currentTime);
const filter = this.ctx.createBiquadFilter();
filter.type = 'lowpass';
filter.frequency.setValueAtTime(300, this.ctx.currentTime);
this.engineGain = this.ctx.createGain();
this.engineGain.gain.setValueAtTime(0.08, this.ctx.currentTime);
this.engineNode.connect(filter);
filter.connect(this.engineGain);
this.engineGain.connect(this.ctx.destination);
this.engineNode.start();
} catch(e) {}
}
updateEngine(speedRatio, boosting) {
if (!this.enabled || !this.ctx || !this.engineNode) return;
const targetFreq = 50 + speedRatio * 180 + (boosting ? 120 : 0);
this.engineNode.frequency.setTargetAtTime(targetFreq, this.ctx.currentTime, 0.1);
if (this.engineGain) {
const targetGain = 0.05 + speedRatio * 0.08 + (boosting ? 0.08 : 0);
this.engineGain.gain.setTargetAtTime(targetGain, this.ctx.currentTime, 0.1);
}
}
playOrbCollect() {
if (!this.enabled || !this.ctx) return;
try {
const osc = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc.type = 'sine';
osc.frequency.setValueAtTime(440, this.ctx.currentTime);
osc.frequency.exponentialRampToValueAtTime(880, this.ctx.currentTime + 0.15);
gain.gain.setValueAtTime(0.2, this.ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, this.ctx.currentTime + 0.15);
osc.connect(gain);
gain.connect(this.ctx.destination);
osc.start();
osc.stop(this.ctx.currentTime + 0.15);
} catch(e) {}
}
playNearMiss() {
if (!this.enabled || !this.ctx) return;
try {
const osc = this.ctx.createOscillator();
const gain = this.ctx.createGain();
osc.type = 'triangle';
osc.frequency.setValueAtTime(300, this.ctx.currentTime);
osc.frequency.linearRampToValueAtTime(600, this.ctx.currentTime + 0.1);
gain.gain.setValueAtTime(0.15, this.ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, this.ctx.currentTime + 0.1);
osc.connect(gain);
gain.connect(this.ctx.destination);
osc.start();
osc.stop(this.ctx.currentTime + 0.1);
} catch(e) {}
}
playCrash() {
if (!this.enabled || !this.ctx) return;
try {
const bufferSize = this.ctx.sampleRate * 0.5;
const buffer = this.ctx.createBuffer(1, bufferSize, this.ctx.sampleRate);
const data = buffer.getChannelData(0);
for (let i = 0; i < bufferSize; i++) {
data[i] = Math.random() * 2 - 1;
}
const noise = this.ctx.createBufferSource();
noise.buffer = buffer;
const filter = this.ctx.createBiquadFilter();
filter.type = 'lowpass';
filter.frequency.setValueAtTime(400, this.ctx.currentTime);
filter.frequency.linearRampToValueAtTime(50, this.ctx.currentTime + 0.5);
const gain = this.ctx.createGain();
gain.gain.setValueAtTime(0.5, this.ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.01, this.ctx.currentTime + 0.5);
noise.connect(filter);
filter.connect(gain);
gain.connect(this.ctx.destination);
noise.start();
} catch(e) {}
}
stopEngine() {
if (this.engineNode) {
try { this.engineNode.stop(); } catch(e) {}
this.engineNode = null;
}
}
}
// ── class: CanyonWorld ──
// Game World, Chunk Manager, and Procedural Generation
class CanyonWorld {
constructor(scene) {
this.scene = scene;
this.chunks = [];
this.chunkLength = 60;
this.chunkCount = 12;
this.spawnZ = 0;
this.destroyZ = 60;
this.difficulty = 1;
// Shared Materials for Low-Poly Aesthetic
this.wallMaterial = new THREE.MeshStandardMaterial({
color: 0x1a092b,
roughness: 0.8,
metalness: 0.2,
flatShading: true
});
this.wallTopMaterial = new THREE.MeshStandardMaterial({
color: 0x3d145c,
roughness: 0.7,
metalness: 0.3,
flatShading: true
});
this.pillarMaterial = new THREE.MeshStandardMaterial({
color: 0x5a189a,
roughness: 0.5,
metalness: 0.5,
flatShading: true
});
this.orbMaterial = new THREE.MeshStandardMaterial({
color: 0x00ffcc,
emissive: 0x00ffcc,
emissiveIntensity: 0.8,
roughness: 0.2,
flatShading: true
});
this.gateMaterial = new THREE.MeshStandardMaterial({
color: 0xff9900,
emissive: 0xff6600,
emissiveIntensity: 0.6,
roughness: 0.3,
wireframe: true
});
// Persistent collection objects
this.orbs = [];
this.obstacles = [];
}
init(initialCount = 12) {
this.clear();
this.spawnZ = 0;
for (let i = 0; i < initialCount; i++) {
this.generateChunk(i === 0 ? 0 : this.spawnZ);
}
}
clear() {
this.chunks.forEach(chunk => this.scene.remove(chunk.group));
this.chunks = [];
this.orbs = [];
this.obstacles = [];
}
update(playerZ, difficulty) {
this.difficulty = difficulty;
// Generate ahead
while (this.spawnZ > playerZ - (this.chunkCount * this.chunkLength)) {
this.generateChunk(this.spawnZ);
this.spawnZ -= this.chunkLength;
}
// Remove behind
for (let i = this.chunks.length - 1; i >= 0; i--) {
const chunk = this.chunks[i];
if (chunk.z > playerZ + 40) {
this.scene.remove(chunk.group);
// Clean up orbs/obstacles in chunk
chunk.orbs.forEach(orb => {
const idx = this.orbs.indexOf(orb);
if (idx !== -1) this.orbs.splice(idx, 1);
});
chunk.obstacles.forEach(obs => {
const idx = this.obstacles.indexOf(obs);
if (idx !== -1) this.obstacles.splice(idx, 1);
});
this.chunks.splice(i, 1);
}
}
}
generateChunk(zPos) {
const group = new THREE.Group();
const chunkOrbs = [];
const chunkObstacles = [];
const width = 45;
const height = 30;
// --- CANYON WALLS (Left and Right) ---
const segments = 6;
const segLen = this.chunkLength / segments;
for (let s = 0; s < segments; s++) {
const currentZ = zPos - (s * segLen);
const nextZ = currentZ - segLen;
// Noise offset based on position
const n1 = Math.sin(currentZ * 0.05) * 8;
const n2 = Math.cos(currentZ * 0.07) * 8;
const leftWidth = width + n1;
const rightWidth = width + n2;
// Left Wall Segment
const leftGeo = new THREE.BoxGeometry(20, height + Math.abs(n1), segLen);
const leftMesh = new THREE.Mesh(leftGeo, this.wallMaterial);
leftMesh.position.set(-width - 10 + n1/2, (height + Math.abs(n1))/2 - 5, currentZ - segLen/2);
leftMesh.castShadow = true;
leftMesh.receiveShadow = true;
group.add(leftMesh);
chunkObstacles.push({ mesh: leftMesh, type: 'wall', radius: width + 5 });
// Right Wall Segment
const rightGeo = new THREE.BoxGeometry(20, height + Math.abs(n2), segLen);
const rightMesh = new THREE.Mesh(rightGeo, this.wallMaterial);
rightMesh.position.set(width + 10 + n2/2, (height + Math.abs(n2))/2 - 5, currentZ - segLen/2);
rightMesh.castShadow = true;
rightMesh.receiveShadow = true;
group.add(rightMesh);
chunkObstacles.push({ mesh: rightMesh, type: 'wall', radius: width + 5 });
// Floor
const floorGeo = new THREE.PlaneGeometry(width * 2, segLen);
const floorMat = new THREE.MeshStandardMaterial({
color: 0x12051c,
roughness: 0.9,
flatShading: true
});
const floor = new THREE.Mesh(floorGeo, floorMat);
floor.rotation.x = -Math.PI / 2;
floor.position.set(0, -5, currentZ - segLen/2);
floor.receiveShadow = true;
group.add(floor);
}
// --- OBSTACLES (Floating Monoliths & Tight Squeezes) ---
// Spawn probability increases with difficulty
if (Math.random() < 0.7 + (this.difficulty * 0.05)) {
const obsType = Math.random();
const obsZ = zPos - (this.chunkLength * 0.5);
if (obsType < 0.4) {
// Floating Monolith Pillar in center
const pGeo = new THREE.BoxGeometry(8, 25, 8);
const pillar = new THREE.Mesh(pGeo, this.pillarMaterial);
const offsetX = (Math.random() - 0.5) * 20;
pillar.position.set(offsetX, 5, obsZ);
pillar.castShadow = true;
group.add(pillar);
chunkObstacles.push({ mesh: pillar, type: 'pillar', radius: 6, bounds: { x: offsetX, z: obsZ, sizeX: 8, sizeZ: 8 } });
} else if (obsType < 0.7) {
// Dual Pillars (Tight Squeeze)
const pGeo1 = new THREE.BoxGeometry(6, 25, 6);
const pGeo2 = new THREE.BoxGeometry(6, 25, 6);
const p1 = new THREE.Mesh(pGeo1, this.pillarMaterial);
const p2 = new THREE.Mesh(pGeo2, this.pillarMaterial);
p1.position.set(-12, 5, obsZ);
p2.position.set(12, 5, obsZ);
group.add(p1);
group.add(p2);
chunkObstacles.push({ mesh: p1, type: 'pillar', radius: 5, bounds: { x: -12, z: obsZ, sizeX: 6, sizeZ: 6 } });
chunkObstacles.push({ mesh: p2, type: 'pillar', radius: 5, bounds: { x: 12, z: obsZ, sizeX: 6, sizeZ: 6 } });
} else {
// Arch / Bridge
const archGeo = new THREE.BoxGeometry(36, 4, 6);
const arch = new THREE.Mesh(archGeo, this.gateMaterial);
arch.position.set(0, 12, obsZ);
group.add(arch);
chunkObstacles.push({ mesh: arch, type: 'arch', radius: 15, bounds: { y: 12, z: obsZ } });
}
}
// --- ENERGY ORBS ---
// Spawn 2 to 4 glowing orbs per chunk
const orbCount = 2 + Math.floor(Math.random() * 3);
const orbGeo = new THREE.OctahedronGeometry(1.8, 0);
for (let o = 0; o < orbCount; o++) {
const orbMesh = new THREE.Mesh(orbGeo, this.orbMaterial);
const orbX = (Math.random() - 0.5) * 30;
const orbY = 2 + Math.random() * 10;
const orbZ = zPos - (o * (this.chunkLength / orbCount)) - (Math.random() * 10);
orbMesh.position.set(orbX, orbY, orbZ);
group.add(orbMesh);
const orbData = {
mesh: orbMesh,
x: orbX,
y: orbY,
z: orbZ,
collected: false
};
chunkOrbs.push(orbData);
this.orbs.push(orbData);
}
this.scene.add(group);
this.chunks.push({
z: zPos,
group: group,
orbs: chunkOrbs,
obstacles: chunkObstacles
});
// Append to global obstacles list
chunkObstacles.forEach(obs => this.obstacles.push(obs));
}
}
</script>
</body>
</html>