Spaces:
Running
Running
Update play.html
Browse files13 unmodified lines141516171819204 unmodified lines25262728293031116 unmodified lines148149150151152153154210 unmodified lines36536636736836937037114 unmodified lines3863873883893903913923933942 unmodified lines39739839940040140240319 unmodified lines42342442542642742842923 unmodified lines45345445545645745845941 unmodified lines50150250350450550650724 unmodified lines53253353453553653753843 unmodified lines5825835845855865875885895905915925935945955965971 unmodified line59960060160260360460531 unmodified lines63763863964064164264364464564664764864965065165265313 unmodified lines.scanlines { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1)); background-size: 100% 4px; position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10; }.ui-panel { backdrop-filter: blur(5px); background: rgba(20, 20, 20, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.2s; }/* BTN PIÙ GRANDE */.btn { background: var(--neon-green); color: #000; padding: 20px 50px; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; cursor: pointer; border-radius: 4px; box-shadow: 0 0 20px rgba(0, 255, 65, 0.4); transition: 0.2s; border: none; }.btn:hover { transform: scale(1.05); background: #fff; box-shadow: 0 0 40px rgba(0, 255, 65, 0.6); }4 unmodified lines.floating-message {position: absolute;font-weight: 800;font-size: 1.2rem;text-align: left;pointer-events: none;text-shadow: 2px 2px 0px #000;116 unmodified linesBAR_FULL: "🔥 MODALITÀ GENIO ATTIVA! 🔥"},// ORA CON LISTE DI MESSAGGI RANDOM!ENTITIES: {LEGACY: {CHAR: '☕',210 unmodified linesconst GROUND_H = 80;let state = { playing: false, speed: GAME_CONFIG.SPEED.INITIAL, score: 0, legacy: 0, flow: 50, frame: 0, phaseIdx: 0, shake: 0, combo: 0 };let player = { x: 80, y: 0, w: 35, h: 35, dy: 0, grounded: false, canDouble: false, amplified: 0, stretch: 1 };let entities = [], particles = [], bgStars = [];const dom = {14 unmodified lines};function setupUI() {// TITOLI RIMOSSI ANCHE DAL JS// document.getElementById('title-main').innerText = GAME_CONFIG.TEXTS.TITLE;// document.getElementById('subtitle-main').innerText = GAME_CONFIG.TEXTS.SUBTITLE;document.getElementById('lbl-phase').innerText = GAME_CONFIG.TEXTS.LBL_PHASE;document.getElementById('lbl-metrics').innerText = GAME_CONFIG.TEXTS.LBL_METRICS;document.getElementById('lbl-score').innerText = GAME_CONFIG.TEXTS.LBL_SCORE;2 unmodified linesdocument.getElementById('btn-restart').innerText = GAME_CONFIG.TEXTS.RESTART_BTN;document.getElementById('controls-hint').innerText = GAME_CONFIG.TEXTS.CONTROLS;// Use first element of array for description preview if needed, or just static textdocument.getElementById('icon-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.CHAR;document.getElementById('title-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.TITLE;document.getElementById('desc-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.DESC;19 unmodified linesfunction initGame() {Object.assign(state, { playing: true, speed: GAME_CONFIG.SPEED.INITIAL, score: 0, legacy: 0, flow: 50, frame: 0, phaseIdx: 0, shake: 0, combo: 0 });Object.assign(player, { y: state.groundY - player.h, dy: 0, grounded: true, amplified: 0, stretch: 1 });entities = []; particles = [];dom.start.style.display = 'none';23 unmodified linesplayer.stretch = 1.2;state.flow = Math.max(0, state.flow - 25);explosion(player.x + player.w/2, player.y + player.h, 15, '#00ff41');floatText("ELEVAZIONE", player.x + 40, player.y - 40, '#00ff41'); // Offset right}updateHUD();}41 unmodified linesmanageEntities(currentSpd);drawParticles();ctx.shadowBlur = 10; ctx.shadowColor = player.amplified > 0 ? '#00ff41' : '#444';ctx.fillStyle = '#111'; ctx.fillRect(0, state.groundY, canvas.width, canvas.height - state.groundY);ctx.strokeStyle = '#00ff41'; ctx.lineWidth = 4; ctx.beginPath();ctx.moveTo(0, state.groundY); ctx.lineTo(canvas.width, state.groundY); ctx.stroke(); ctx.shadowBlur = 0;24 unmodified lineslet drawH = player.h * player.stretch, drawW = player.w * (1/player.stretch);let drawX = player.x + (player.w - drawW)/2, drawY = player.y + (player.h - drawH);ctx.fillStyle = player.amplified > 0 ? ((state.frame % 4 < 2) ? '#fff' : '#00ff41') : '#00ff41';if (state.frame % 3 === 0) particles.push({ x: drawX, y: drawY, w: drawW, h: drawH, life: 0.6, type: 'trail', color: ctx.fillStyle });43 unmodified linesfunction handleHit(e) {e.active = false;// Pick RANDOM Messagelet msgList = e.conf.MSG;let randomMsg = Array.isArray(msgList) ? msgList[Math.floor(Math.random() * msgList.length)] : msgList;if (e.type === 'OBSTACLE') {if (player.amplified > 0) {state.shake = 20;explosion(e.x + e.w/2, e.y + e.h/2, 25, '#ff0055');floatText(randomMsg, e.x + 80, e.y - 20, '#fff'); // White text for destructionstate.score += 15; state.combo++;showCombo();} else {1 unmodified line}} else {explosion(e.x + e.w/2, e.y + e.h/2, 12, e.conf.COLOR);// Colore del testo uguale all'entità raccoltafloatText(randomMsg, e.x + 80, e.y - 40, e.conf.COLOR);if (e.type === 'LEGACY') {31 unmodified lines}}// Function modified to shift text right and use new CSS classfunction floatText(txt, x, y, col) {let el = document.createElement('div');el.className = 'floating-message';el.innerText = txt;// Spostamento a destra di base (+100px) per evitare il bordo sinistroel.style.left = (x + 60) + 'px';el.style.top = y + 'px';el.style.color = col;document.body.appendChild(el);// Timeout aumentato per matchare l'animazione CSSsetTimeout(() => el.remove(), 4000);}13 unmodified lines1415161718194 unmodified lines24252627282930116 unmodified lines147148149150151152153154155156157158159160161162163164165166210 unmodified lines37737837938038138238314 unmodified lines3983994004014024032 unmodified lines40640740840941041119 unmodified lines43143243343443543643723 unmodified lines46146246346446546646746846941 unmodified lines51151251351451551651751851952024 unmodified lines54554654754854955055155243 unmodified lines5965975985996006016026036046056066076086096101 unmodified line61261361461561661731 unmodified lines64965065165265365465565665765865966066166213 unmodified lines.scanlines { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1)); background-size: 100% 4px; position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10; }.ui-panel { backdrop-filter: blur(5px); background: rgba(20, 20, 20, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.2s; }.btn { background: var(--neon-green); color: #000; padding: 20px 50px; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; cursor: pointer; border-radius: 4px; box-shadow: 0 0 20px rgba(0, 255, 65, 0.4); transition: 0.2s; border: none; }.btn:hover { transform: scale(1.05); background: #fff; box-shadow: 0 0 40px rgba(0, 255, 65, 0.6); }4 unmodified lines.floating-message {position: absolute;font-weight: 800;font-size: 0.85rem;text-align: left;pointer-events: none;text-shadow: 2px 2px 0px #000;116 unmodified linesBAR_FULL: "🔥 MODALITÀ GENIO ATTIVA! 🔥"},JUMP_MESSAGES: ["SALTO DI QUALITÀ!","SKIP MEETING!","BYPASS!","NEXT LEVEL!","ELEVATION!","QUOTA RAGGIUNTA!","CLOUD JUMP!","SORPASSO!","HOP!","AGILE JUMP!","SCALABILITÀ!"],ENTITIES: {LEGACY: {CHAR: '☕',210 unmodified linesconst GROUND_H = 80;let state = { playing: false, speed: GAME_CONFIG.SPEED.INITIAL, score: 0, legacy: 0, flow: 50, frame: 0, phaseIdx: 0, shake: 0, combo: 0 };let player = { x: 80, y: 0, w: 48, h: 48, dy: 0, grounded: false, canDouble: false, amplified: 0, stretch: 1 };let entities = [], particles = [], bgStars = [];const dom = {14 unmodified lines};function setupUI() {document.getElementById('lbl-phase').innerText = GAME_CONFIG.TEXTS.LBL_PHASE;document.getElementById('lbl-metrics').innerText = GAME_CONFIG.TEXTS.LBL_METRICS;document.getElementById('lbl-score').innerText = GAME_CONFIG.TEXTS.LBL_SCORE;2 unmodified linesdocument.getElementById('btn-restart').innerText = GAME_CONFIG.TEXTS.RESTART_BTN;document.getElementById('controls-hint').innerText = GAME_CONFIG.TEXTS.CONTROLS;document.getElementById('icon-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.CHAR;document.getElementById('title-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.TITLE;document.getElementById('desc-legacy').innerText = GAME_CONFIG.ENTITIES.LEGACY.DESC;19 unmodified linesfunction initGame() {Object.assign(state, { playing: true, speed: GAME_CONFIG.SPEED.INITIAL, score: 0, legacy: 0, flow: 50, frame: 0, phaseIdx: 0, shake: 0, combo: 0 });Object.assign(player, { y: state.groundY - player.h, dy: 0, grounded: true, amplified: 0, stretch: 1, w: 48, h: 48 });entities = []; particles = [];dom.start.style.display = 'none';23 unmodified linesplayer.stretch = 1.2;state.flow = Math.max(0, state.flow - 25);explosion(player.x + player.w/2, player.y + player.h, 15, '#00ff41');let msg = GAME_CONFIG.JUMP_MESSAGES[Math.floor(Math.random() * GAME_CONFIG.JUMP_MESSAGES.length)];floatText(msg, player.x + 40, player.y - 40, '#00ff41');}updateHUD();}41 unmodified linesmanageEntities(currentSpd);drawParticles();// SHADOW LOGIC: White if amplified, else dark grayctx.shadowBlur = 10;ctx.shadowColor = player.amplified > 0 ? '#ffffff' : '#444';ctx.fillStyle = '#111'; ctx.fillRect(0, state.groundY, canvas.width, canvas.height - state.groundY);ctx.strokeStyle = '#00ff41'; ctx.lineWidth = 4; ctx.beginPath();ctx.moveTo(0, state.groundY); ctx.lineTo(canvas.width, state.groundY); ctx.stroke(); ctx.shadowBlur = 0;24 unmodified lineslet drawH = player.h * player.stretch, drawW = player.w * (1/player.stretch);let drawX = player.x + (player.w - drawW)/2, drawY = player.y + (player.h - drawH);// PLAYER COLOR LOGIC: White if amplified, else Neon Greenctx.fillStyle = player.amplified > 0 ? '#ffffff' : '#00ff41';if (state.frame % 3 === 0) particles.push({ x: drawX, y: drawY, w: drawW, h: drawH, life: 0.6, type: 'trail', color: ctx.fillStyle });43 unmodified linesfunction handleHit(e) {e.active = false;let msgList = e.conf.MSG;let randomMsg = Array.isArray(msgList) ? msgList[Math.floor(Math.random() * msgList.length)] : msgList;if (e.type === 'OBSTACLE') {if (player.amplified > 0) {state.shake = 20;// White explosion for destruction in God Modeexplosion(e.x + e.w/2, e.y + e.h/2, 25, '#ffffff');floatText(randomMsg, e.x + 80, e.y - 20, '#fff');state.score += 15; state.combo++;showCombo();} else {1 unmodified line}} else {explosion(e.x + e.w/2, e.y + e.h/2, 12, e.conf.COLOR);floatText(randomMsg, e.x + 80, e.y - 40, e.conf.COLOR);if (e.type === 'LEGACY') {31 unmodified lines}}function floatText(txt, x, y, col) {let el = document.createElement('div');el.className = 'floating-message';el.innerText = txt;el.style.left = (x + 60) + 'px';el.style.top = y + 'px';el.style.color = col;document.body.appendChild(el);setTimeout(() => el.remove(), 4000);}
play.html+29-20