<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>Yalancı Parkur - Kolay Versiyon</title>
<style>
body { margin: 0; background: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: white; font-family: sans-serif; }
canvas { background: #222; border: 3px solid #00FFCC; box-shadow: 0 0 20px rgba(0,255,204,0.3); }
.info { margin-bottom: 10px; text-align: center; }
</style>
</head>
<body>
<div class="info">
<h2 id="status">Bölüm 1: Platforma Güvenme!</h2>
<p>WASD ile hareket et. Orta platform 2 saniye sonra düşer.</p>
</div>
<canvas id="game"></canvas>
<script>
const canvas = document.getElementById('game');
const ctx = canvas.getContext('2d');
canvas.width = 800;
canvas.height = 400;
let player = { x: 50, y: 300, w: 30, h: 30, vx: 0, vy: 0, speed: 5, jump: 14, grounded: false };
let goal = { x: 720, y: 310, w: 40, h: 40 };
let currentLevel = 1;
let platforms = [];
let keys = {};
let trapTimer = 0; // Platformun düşmesi için gereken süre sayacı
window.addEventListener('keydown', e => keys[e.code] = true);
window.addEventListener('keyup', e => keys[e.code] = false);
function setupLevel(lvl) {
player.x = 50; player.y = 300; player.vx = 0; player.vy = 0;
platforms = [];
trapTimer = 0;
if (lvl === 1) {
document.getElementById('status').innerText = "Bölüm 1: Platforma Güvenme!";
platforms.push({ x: 0, y: 350, w: 250, h: 50 });
platforms.push({ x: 300, y: 350, w: 200, h: 50 }); // Tuzaklı platform
platforms.push({ x: 550, y: 350, w: 250, h: 50 });
goal.x = 720;
} else if (lvl === 2) {
document.getElementById('status').innerText = "Bölüm 2: Bayrak Nerede?";
platforms.push({ x: 0, y: 350, w: 800, h: 50 });
goal.x = 700;
}
}
function update() {
if (keys['KeyA']) player.vx = -player.speed;
else if (keys['KeyD']) player.vx = player.speed;
else player.vx =