three实现第一人称射击游戏效果
代码语言:html
所属分类:游戏
代码描述:three实现第一人称射击游戏效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
#instructions {
width: 100%;
height: 100%;
user-select: none;
text-shadow: 1px 1px 1px #9E9E9E;
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
box-orient: horizontal;
-webkit-box-pack: center;
-moz-box-pack: center;
box-pack: center;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
color: #ffffff;
text-align: center;
font-family: Arial;
font-size: 14px;
line-height: 24px;
cursor: pointer;
}
</style>
</head>
<body translate="no">
<body style="margin: 0;">
<div id="instructions">
<div>
<h1>点击开始</h1>
射击:单击鼠标左键<br />
移动: 键盘W-A-S-D 或者 箭头<br />
跑: SHIFT键<br />
跳跃: 空格键<br />
看: 移动鼠标
退出:esc键
</div>
</div>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/three.r118.js"></script>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/dat.gui-min.js"></script>
<script>
THREE.FirstPersonControls = function ( camera, MouseMoveSensitivity = 0.002, speed = 800.0, jumpHeight = 350.0, height = 30.0) {
var scope = this;
scope.MouseMoveSensitivity = MouseMoveSensitivity;
scope.speed = speed;
scope.height = h.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0