Untitled

Anonymous
plain_text
02/11/2026 9:10 PM
1.7 KB
10
Indexable
<!DOCTYPE html>
<html>
<head>
    <title>Simple Running Game</title>
    <style>
        body {
            text-align: center;
            font-family: Arial;
            background-color: #222;
            color: white;
        }

        #gameArea {
            width: 600px;
            height: 200px;
            border: 3px solid white;
            margin: 20px auto;
            position: relative;
            overflow: hidden;
            background-color: #333;
        }

        #player {
            width: 40px;
            height: 40px;
            background-color: lime;
            position: absolute;
            top: 80px;
            left: 0;
        }

        #winnerText {
            font-size: 40px;
            color: yellow;
            display: none;
            margin-top: 20px;
        }

        button {
            padding: 10px 20px;
            font-size: 18px;
            cursor: pointer;
        }
    </style>
</head>
<body>

<h1>Running Game</h1>

<div id="gameArea">
    <div id="player"></div>
</div>

<button onclick="showWinner()">WIN</button>

<div id="winnerText">WINNER 🎉</div>

<script>
    let player = document.getElementById("player");
    let position = 0;

    function run() {
        position += 2;
        if (position > 560)
Editor is loading...
Leave a Comment