| <!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/three@0.128.0/examples/js/loaders/OBJLoader.js"></script> |
| |
| |
| <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> |
|
|