Meta Description" name="description" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Indian Car Test Drive - Army Edition</title>
<style>
body { margin: 0; font-family: 'Arial Black', sans-serif; background: #1a1a1a; color: white; overflow: hidden; }
#gameUI { position: absolute; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.8); z-index: 10; }
/* Army Man Logo Style */
#logo { width: 300px; height: 300px; border: 5px solid #4b5320; border-radius: 50%; background: url('https://img.freepik.com/free-photo/soldier-with-gun-silhouette_23-2148181410.jpg') center/cover; margin-bottom: 20px; box-shadow: 0 0 20px #4b5320; }
button { padding: 15px 50px; font-size: 24px; cursor: pointer; background: #4b5320; color: white; border: none; border-radius: 10px; transition: 0.3s; }
button:hover { background: #6b7340; transform: scale(1.1); }
.settings { margin-top: 20px; background: rgba(255,255,255,0.1); padding: 20px; border-radius: 15px; width: 300px; }
input[type="range"] { width: 100%; accent-color: #4b5320; }
canvas { display: block; }
#info { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.5); padding: 10px; border-radius: 5px; pointer-events: none; }
</style>
</head>
<body>
<div id="gameUI">
<div id="logo"></div>
<h1>INDIAN TEST DRIVE</h1>
<button onclick="startGame()">START GAME</button>
<div class="settings">
<label>π Sound Volume</label>
<input type="range" id="volume" min="0" max="100" value="80">
<br><br>
<label>πΉοΈ Handling Sensitivity</label>
<input type="range" id="handling" min="1" max="10" value="5">
</div>
<p>Cars: Suzuki to Defender (Unlimited Speed!)</p>
</div>
<div id="info" style="display:none;">
Speed: <span id="speedDisplay">0</span> km/h <br>
Car: <span id="carName">Defender</span> <br>
Controls: ARROW KEYS to Drive
</div>
<canvas id="gameCanvas"></canvas>
<script>
const canvas = document.getElementById('gameCanvas');
const ctx = canvas.getContext('2d');
const ui = document.getElementById('gameUI');
const speedTxt = document.getElementById('speedDisplay');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
let gameRunning = false;
let speed = 0;
let roadOffset = 0;
let carX = canvas.width / 2 - 40;
let sensitivity = 5;
function startGame() {
ui.style.display = 'none';
document.getElementById('info').style.display = 'block';
gameRunning = true;
sensitivity = document.getElementById('handling').value;
animate();
}
let keys = {};
window.addEventListener('keydown', (e) => keys[e.code] = true);
window.addEventListener('keyup', (e) => keys[e.code] = false);
function drawRoad() {
ctx.fillStyle = "#333"; // Road color
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeStyle = "white";
ctx.setLineDash([40, 40]);
ctx.lineWidth = 5;
ctx.beginPath();
ctx.moveTo(canvas.width / 2, 0);
ctx.lineTo(canvas.width / 2, canvas.height);
ctx.lineDashOffset = -roadOffset;
ctx.stroke();
}
function drawCar() {
// Humne yahan ek 'Defender' jaisi SUV draw ki hai
ctx.fillStyle = "darkgreen"; // Army Color Defender
ctx.fillRect(carX, canvas.height - 150, 80, 120);
// Windows
ctx.fillStyle = "lightblue";
ctx.fillRect(carX + 10, canvas.height - 130, 60, 30);
// Wheels
ctx.fillStyle = "black";
ctx.fillRect(carX - 5, canvas.height - 140, 10, 30);
ctx.fillRect(carX + 75, canvas.height - 140, 10, 30);
}
function animate() {
if (!gameRunning) return;
drawRoad();
drawCar();
// Physics Logic
if (keys['ArrowUp']) speed += 0.5; // Unlimited speed ka logic
else if (keys['ArrowDown']) speed -= 0.5;
else speed *= 0.99; // Natural slow down
if (keys['ArrowLeft']) carX -= (speed * 0.05 * sensitivity);
if (keys['ArrowRight']) carX += (speed * 0.05 * sensitivity);
roadOffset += speed;
speedTxt.innerText = Math.floor(speed * 10);
requestAnimationFrame(animate);
}
</script>
</body>
</html>2
2
82KB
82KB
108.0ms
132.0ms
229.0ms