three实现小船河流行驶躲避桥梁游戏代码
代码语言:html
所属分类:其他
代码描述:3d小船行驶躲避桥梁游戏
代码标签: three 小船 河流 行驶 躲避 桥梁 游戏 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>激流勇进:水上飞梭躲避战</title>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #1a1a1a;
font-family: 'Microsoft YaHei', sans-serif;
user-select: none;
-webkit-user-select: none;
}
#canvas-container {
width: 100vw;
height: 100vh;
display: block;
}
/* 游戏UI图层 */
#ui-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
padding: 20px;
}
/* 顶部得分 */
#hud {
display: flex;
justify-content: space-between;
pointer-events: auto;
}
.score-box {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 10px 20px;
border-radius: 15px;
font-size: 20px;
font-weight: bold;
border: 2px solid #00d2ff;
box-shadow: 0 0 10px rgba(0,210,255,0.5);
text-shadow: 0 0 5px #00d2ff;
}
/* 警告指示器 */
#warning-prompt {
position: absolute;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
color: #ff3333;
font-size: 40px;
font-weight: 900;
text-align: center;
text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
display: none;
animation: blink 0.5s infinite alternate;
}
@keyframes blink {
from { opacity: 1; }
to { opacity: 0.3; }
}
/* 启动与结束弹窗 */
.modal {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(15, 25, 40, 0.9);
border: 3px solid #00d2ff;
border-radius: 20px;
padding: 30px 50px;
color: white;
text-align: center;
box-shadow: 0 0 30px rgba(0,210,255,0.8);
pointer-events: auto;
z-index: 10;
}
.modal h1 {
margin-top: 0;
color: #00d2ff;
text-shadow: 0 0 10px #00d2ff;
font-size: 32px;
}
.modal p {
font-size: 16px;
.........完整代码请登录后点击上方下载按钮下载查看















网友评论0