写一个超级玛丽网页游戏,要完整且复杂的,代码内嵌,不要分开
- User
写一个超级玛丽网页游戏,要完整且复杂的,代码内嵌,不要分开
Assistant
超级玛丽网页游戏实现
下面是一个完整且复杂的超级玛丽网页游戏实现。这个游戏包含了基本的游戏机制,如玛丽奥的移动、跳跃、敌人、障碍物、碰撞检测和得分系统等。所有代码都放在一个HTML文件中,包括HTML、CSS和JavaScript。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta content="width=device-width, initial-scale=1.0" name="viewport"/> <title>超级玛丽</title> <style> body { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #87CEEB; font-family: 'Arial', sans-serif; overflow: hidden; } .game-container { position: relative; width: 800px; height: 480px; border: 4px solid #333; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); overflow: hidden; } canvas { background-color: #6B8CFF; image-rendering: pixelated; } .game-ui { position: absolute; top: 10px; left: 10px; color: white; font-size: 20px; font-weight: bold; text-shadow: 2px 2px 0 #000; } .start-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; font-size: 24px; } .start-screen h1 { color: #FFD700; font-size: 48px; margin-bottom: 30px; } .start-screen p { margin: 10px 0; } .start-button { margin-top: 30px; padding: 10px 30px; font-size: 24px; background-color: #FF4500; color: white; border: none; border-radius: 5px; cursor: pointer; transition: all 0.3s; } .start-button:hover { background-color: #FF6347; transform: scale(1.05); } </style> </head> <body> <div class="game-container"> <canvas height="480" id="gameCanvas" width="800"></canvas> <div class="game-ui"> <div id="score">分数: 0</div> <div id="lives">生命: 3</div> <div id="coins">金币: 0</div> </div> <div class="start-screen" id="startScreen"> <h1>超级玛丽</h1> <p>方向键: 移动</p> <p>空格键: 跳跃</p> <p>A键: 快跑/射击</p> <button class="start-button" id="startButton">开始游戏</button> </div> </div> <script></script></body></html>
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.