Meta Description" name="description" />
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Onion Runner</title>
<style>
body { margin: 0; overflow: hidden; background: #fce4ec; font-family: Arial, sans-serif; }
canvas { display: block; background: #ba68c8; } /* Onion Purple Background */
#ui { position: absolute; top: 10px; left: 10px; color: white; font-size: 20px; font-weight: bold; }
#msg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; color: white; display: none; background: rgba(0,0,0,0.5); padding: 20px; border-radius: 10px; }
</style>
</head>
<body>
<div id="ui">स्कोर: 0</div>
<div id="msg">
<h1>गेम ओवर!</h1>
<button onclick="resetGame()" style="padding: 10px 20px; font-size: 18px; cursor: pointer;">फिर से खेलें</button>
</div>
<canvas id="gameCanvas"></canvas>
<script>
const canvas = document.getElementById("gameCanvas");
const ctx = canvas.getContext("2d");
const ui = document.getElementById("ui");
const msg = document.getElementById("msg");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// गेम वेरिएबल्स
let score = 0;
let gameActive = true;
let speed = 5;
// खिलाड़ी (Onion Color Player)
const player = {
x: 50,
y: canvas.height - 100,
width: 40,
height: 40,
color: "#f06292
1
1
2KB
2KB
80.0ms
124.0ms
81.0ms