File size: 3,575 Bytes
180b798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Paper Airplane Game</title>
    <style>
        body { 
            margin: 0; 
            overflow: hidden;
        }
        #distance { 
            position: absolute; 
            top: 10px; 
            left: 10px; 
            color: white; 
            font-family: Arial, sans-serif;
        }
        #finalScore { 
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            color: white; 
            font-size: 24px; 
            font-family: Arial, sans-serif;
        }
        #instructions { 
            position: absolute; 
            top: 10px; 
            right: 10px; 
            color: white; 
            font-family: Arial, sans-serif;
            max-width: 300px;
            font-size: 12px;
        }
        #restart { 
            position: absolute; 
            top: 60%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            font-size: 18px; 
            padding: 10px 20px;
        }
    </style>
</head>
<body>
    <div id="distance">Distance: 0</div>
    <div id="finalScore" style="display: none;">Final Distance: 0</div>
    <div id="spaceToRestart" style="position: absolute; top: 70%; left: 50%; transform: translate(-50%, -50%); color: white; font-family: Arial, sans-serif; font-size: 16px; display: none;">Press SPACE to restart</div>
    <div id="instructions">
        <p>Hold the space bar (or touch the screen on mobile) to build power, then release to launch the airplane at a 45-degree angle.</p>
        <p>Use left and right arrow keys to steer the airplane during flight. Press up arrow to dive.</p>
        <p>During flight, hold the down arrow key to boost upward (limited boost power).</p>
        <p>Collect green globes to recharge your boost power.</p>
        <p>Avoid buildings and fly as far as possible.</p>
    </div>
    <div id="powerGauge" style="position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 200px; height: 20px; background-color: #ccc; display: none;">
        <div style="position: absolute; bottom: 25px; width: 100%; text-align: center; color: white; font-family: Arial, sans-serif;">Hold SPACE</div>
        <div id="powerBar" style="width: 0%; height: 100%; background-color: #f00;"></div>
    </div>
    <div id="boostGauge" style="position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); width: 200px; height: 20px; background-color: #ccc; display: none;">
        <div style="position: absolute; bottom: 25px; width: 100%; text-align: center; color: white; font-family: Arial, sans-serif;">Boost power</div>
        <div id="boostBar" style="width: 0%; height: 100%; background-color: #00ff00;"></div>
    </div>
    <button id="restart" style="display: none;">Restart</button>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/loaders/OBJLoader.js"></script>
    
    <!-- Audio elements -->
    <audio id="backgroundMusic" loop>
        <source src="soundtrack.mp3" type="audio/mpeg">
        Your browser does not support the audio element.
    </audio>
    <audio id="pingSound">
        <source src="ping.mp3" type="audio/mpeg">
        Your browser does not support the audio element.
    </audio>
    
    <script src="script.js"></script>

</body>
</html>