Meta Description" name="description" />

Share this result

Previews are deleted daily. Get a permanent share link sent to your inbox:
Script
<!DOCTYPE html><html> <head> <title>Subway Surfers Advanced Clone</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { margin: 0; overflow: hidden; background: #111; font-family: Arial; } canvas { display: block; margin: auto; background: linear-gradient(#1e1e1e,#333); } </style> </head> <body> <canvas id="gameCanvas" width="400" height="650"></canvas> <script> const canvas = document.getElementById("gameCanvas"); const ctx = canvas.getContext("2d");let lanes = [100, 180, 260]; let player = { lane: 1, x: lanes[1], y: 520, w: 40, h: 40, vy: 0, jumping: false, sliding: false }; let obstacles = []; let coins = []; let speed = 4; let score = 0; let coinScore = 0; function spawnObstacle() { let lane = Math.floor(Math.random()*3); obstacles.push({x: lanes[lane], y: -40, w: 40, h: 40}); } function spawnCoin() { let lane = Math.floor(Math.random()*3); coins.push({x: lanes[lane]+10, y: -20, r: 10}); } function drawPlayer() { ctx.fillStyle = "#00ffcc"; if(player.sliding){ ctx.fillRect(player.x, player.y+20, player.w, player.h/2); } else { ctx.fillRect(player.x, player.y, player.w, player.h); } } function drawObstacles(){ ctx.fillStyle = "red"; obstacles.forEach(o=> ctx.fillRect(o.x,o.y,o.w,o.h)); } function drawCoins(){ ctx.fillStyle = "yellow"; coins.forEach(c=>{ ctx.beginPath(); ctx.arc(c.x,c.y,c.r,0,Math.PI*2); ctx.fill(); }); } function update(){ player.y += player.vy; player.vy += 0.6; if(player.y >= 520){ player.y = 520; player.jumping = false; } obstacles.forEach(o=> o.y += speed); coins.forEach(c=> c.y += speed); obstacles = obstacles.filter(o=> o.y<650); coins = coins.filter(c=> c.y<650); // collision for(let o of obstacles){ if(player.x < o.x+o.w && player.x+player.w > o.x && player.y < o.y+o.h && player.y+player.h > o.y){ alert("Game Over! Score: "+score+" Coins: "+coinScore); location.reload(); } } // coin collect for(let c of coins){ if(player.x < c.x+10 && player.x+player.w > c.x-10 && player.y < c.y+10 && player.y+player.h > c.y-10){ coinScore++; c.y = 700; } } score++; speed += 0.001; } function drawUI(){ ctx.fillStyle="white"; ctx.fillText("Score: "+score,10,20); ctx.fillText("Coins: "+coinScore,10,40); } function gameLoop(){ ctx.clearRect(0,0,400,650); drawPlayer(); drawObstacles(); drawCoins(); update(); drawUI(); requestAnimationFrame(gameLoop); } setInterval(spawnObstacle,1200); setInterval(spawnCoin,800); // controls window.addEventListener("keydown",e=>{ if(e.key==="ArrowLeft" && player.lane>0){ player.lane--; player.x = lanes[player.lane]; } if(e.key==="ArrowRight" && player.lane<2){ player.lane++; player.x = lanes[player.lane]; } if(e.key==="ArrowUp" && !player.jumping){ player.vy = -12; player.jumping = true; } if(e.key==="ArrowDown"){ player.sliding = true; setTimeout(()=> player.sliding=false,500); } }); // mobile touch canvas.addEventListener("touchstart", e=>{ let x = e.touches[0].clientX; if(x < window.innerWidth/3 && player.lane>0){ player.lane--; } else if(x > window.innerWidth*2/3 && player.lane<2){ player.lane++; } else { player.vy = -12; player.jumping = true; } player.x = lanes[player.lane]; }); gameLoop(); </script> </body> </html>
Landing Page
This ad does not have a landing page available
Network Timeline
Performance Summary

1

Requests

1

Domains

3KB

Transfer Size

3KB

Content Size

110.0ms

Dom Content Loaded

176.0ms

First Paint

111.0ms

Load Time
Domain Breakdown
Transfer Size (bytes)
Loading...
Content Size (bytes)
Loading...
Header Size (bytes)
Loading...
Requests
Loading...
Timings (ms)
Loading...
Total Time
Loading...
Content Breakdown
Transfer Size (bytes)
Loading...
Content Size (bytes)
Loading...
Header Size (bytes)
Loading...
Requests
Loading...