About me:
This is just nuts to think id be filling this out in 2021.
Im Nick!
Welcome to whatever I make this to be!
MySpace Premium Gaming Room
MySpace // GAMER_DEN_2006
GAME SPEED:
NORMAL
CHAOTIC
GOD MODE
CRT GLOW:
const canvas = document.getElementById('stage');
const ctx = canvas.getContext('2d');
let width, height;
function resize() {
width = canvas.width = window.innerWidth;
height = canvas.height = window.innerHeight;
}
window.addEventListener('resize', resize);
resize();
// UI Interactive Controls
let gameSpeed = 1;
let glowMultiplier = 0.7;
document.getElementById('intensity').addEventListener('change', (e) => gameSpeed = parseFloat(e.target.value));
document.getElementById('glow').addEventListener('input', (e) => glowMultiplier = parseFloat(e.target.value));
// Simulated Canvas Shooter Logic (TV Screen)
const shooter = {
p1Score: 18,
p2Score: 14,
crosshairX: 0,
crosshairY: 0,
muzzleFlash: 0,
enemies: []
};
function spawnEnemy() {
return {
x: Math.random() * 180 + 10,
y: Math.random() * 80 + 20,
size: Math.random() * 8 + 6,
dx: (Math.random() - 0.5) * 2
};
}
for (let i = 0; i < 4; i++) shooter.enemies.push(spawnEnemy());
// Audio Synth Generator (Web Audio API)
let audioCtx = null;
let isPlaying = false;
document.getElementById('audio-toggle').addEventListener('click', () => {
if (!audioCtx) audioCtx = new (window.AudioContext || window.webkitAudioContext)();
isPlaying = !isPlaying;
document.getElementById('audio-toggle').innerText = isPlaying ? "❚❚ PAUSE" : "▶ PLAY SYNTH";
if (isPlaying) playSynthLoop();
});
function playSynthLoop() {
if (!isPlaying) return;
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
const freqs = [220, 261.63, 329.63, 392.00, 440.00];
const note = freqs[Math.floor(Math.random() * freqs.length)];
osc.type = 'sawtooth';
osc.frequency.setValueAtTime(note, audioCtx.currentTime);
gain.gain.setValueAtTime(0.05, audioCtx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 0.25);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 0.25);
setTimeout(playSynthLoop, 200 / gameSpeed);
}
// Main Canvas Render Loop
function render() {
ctx.clearRect(0, 0, width, height);
// 1. Draw Room Background & Wall Posters
ctx.fillStyle = '#080910';
ctx.fillRect(0, 0, width, height);
// Acoustic Foam Panels Pattern on Wall
ctx.strokeStyle = '#121525';
ctx.lineWidth = 1;
for (let x = 0; x < width; x += 40) {
ctx.beginPath(); ctx.moveTo(x, 0); ctx.lineTo(x, height); ctx.stroke();
}
// 2. Setup TV Screen Dimensions
const tvW = Math.min(width * 0.45, 600);
const tvH = tvW * 0.6;
const tvX = width * 0.1;
const tvY = height * 0.25;
// 3. Render 2D FPS Game Inside TV Screen
ctx.save();
ctx.beginPath();
ctx.rect(tvX, tvY, tvW, tvH);
ctx.clip();
// FPS Game Background
ctx.fillStyle = '#050a15';
ctx.fillRect(tvX, tvY, tvW, tvH);
// Grid/3D corridor effect inside game
ctx.strokeStyle = '#0055ff';
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(tvX, tvY + tvH); ctx.lineTo(tvX + tvW * 0.3, tvY + tvH * 0.4);
ctx.moveTo(tvX + tvW, tvY + tvH); ctx.lineTo(tvX + tvW * 0.7, tvY + tvH * 0.4);
ctx.stroke();
// Render Enemies & Shooter gameplay
ctx.fillStyle = '#ff0055';
shooter.enemies.forEach((e) => {
e.x += e.dx * gameSpeed;
if (e.x < 10 || e.x > tvW - 10) e.dx *= -1;
ctx.fillRect(tvX + e.x, tvY + e.y, e.size, e.size * 1.5);
});
// Gun Muzzle Flash & Action Animations
if (Math.random() < 0.2 * gameSpeed) {
shooter.muzzleFlash = 5;
shooter.p1Score += Math.floor(Math.random() * 2);
}
if (shooter.muzzleFlash > 0) {
ctx.fillStyle = 'rgba(255, 230, 100, 0.8)';
ctx.beginPath();
ctx.arc(tvX + tvW * 0.5, tvY + tvH * 0.7, 35, 0, Math.PI * 2);
ctx.fill();
shooter.muzzleFlash--;
}
// Gun Barrel (P1 Silhouette)
ctx.fillStyle = '#111';
ctx.fillRect(tvX + tvW * 0.45, tvY + tvH * 0.65, tvW * 0.1, tvH * 0.35);
// HUD Score Overlay
ctx.fillStyle = '#00f0ff';
ctx.font = 'bold 14px "Courier New"';
ctx.fillText(`P1: [K/D ${shooter.p1Score}]`, tvX + 15, tvY + 25);
ctx.fillStyle = '#ff0055';
ctx.fillText(`P2: [K/D ${shooter.p2Score}]`, tvX + 15, tvY + 45);
ctx.restore();
// CRT TV Bezel Body
ctx.strokeStyle = '#222533';
ctx.lineWidth = 12;
ctx.strokeRect(tvX - 6, tvY - 6, tvW + 12, tvH + 12);
// 4. Dynamic CRT Ambient Light Casting
const flashBrightness = (shooter.muzzleFlash > 0 ? 0.4 : 0.1) * glowMultiplier;
const glowGrad = ctx.createRadialGradient(
tvX + tvW/2, tvY + tvH/2, 50,
tvX + tvW/2, tvY + tvH/2, tvW * 1.4
);
glowGrad.addColorStop(0, `rgba(0, 180, 255, ${0.35 * glowMultiplier + flashBrightness})`);
glowGrad.addColorStop(0.5, `rgba(255, 0, 85, ${0.15 * glowMultiplier})`);
glowGrad.addColorStop(1, 'rgba(0, 0, 0, 0)');
ctx.fillStyle = glowGrad;
ctx.fillRect(0, 0, width, height);
// 5. Gamer Silhouettes on the Couch
const couchY = height * 0.58;
const gamerX = width * 0.52;
// Couch Base
ctx.fillStyle = '#0c0d14';
ctx.fillRect(gamerX - 40, couchY + 80, 380, 120);
// Gamer 1 (Holding Controller)
ctx.fillStyle = '#05060a';
ctx.beginPath();
ctx.arc(gamerX + 40, couchY + 20, 28, 0, Math.PI * 2); // Head
ctx.fill();
ctx.fillRect(gamerX + 15, couchY + 48, 55, 90); // Body
// Gamer 2
ctx.beginPath();
ctx.arc(gamerX + 140, couchY + 30, 26, 0, Math.PI * 2); // Head
ctx.fill();
ctx.fillRect(gamerX + 115, couchY + 56, 50, 85); // Body
// Xbox Controllers with Glowing LEDs
ctx.fillStyle = '#00ff66';
ctx.shadowColor = '#00ff66';
ctx.shadowBlur = 10;
ctx.beginPath();
ctx.arc(gamerX + 25, couchY + 80, 4, 0, Math.PI * 2); // P1 Controller Light
ctx.arc(gamerX + 125, couchY + 88, 4, 0, Math.PI * 2); // P2 Controller Light
ctx.fill();
ctx.shadowBlur = 0; // Reset Shadow
// CRT Scanline Overlay Effect across full screen
ctx.fillStyle = 'rgba(0, 0, 0, 0.15)';
for (let y = 0; y < height; y += 4) {
ctx.fillRect(0, y, width, 2);
}
requestAnimationFrame(render);
}
render();