小黑猫js小游戏
代码语言:html
所属分类:游戏
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>小黑猫</title>
<script type='text/javascript' src='http://repo.bfw.wiki/bfwrepo/js/three.js'></script>
<script type='text/javascript' src='http://repo.bfw.wiki/bfwrepo/js/TweenMax.min.js'></script>
<script type='text/javascript' src='http://repo.bfw.wiki/bfwrepo/js/OrbitControls.js'></script>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
#world{
position: absolute;
width:100%;
height: 100%;
background-color: #6ecccc;
overflow:hidden;
}
#credits{
position:absolute;
width:100%;
margin: auto;
bottom:0;
margin-bottom:20px;
font-family:'Open Sans', sans-serif;
color:#328685;
font-size:0.7em;
text-transform: uppercase;
text-align : center;
}
#credits a {
color:#328685;
}
#credits a:hover {
color:#630d15;
}
</style>
</head>
<body>
<div id="world"></div>
</body>
<script>
Cat=function(){this.threeGroup=new THREE.Group();var yellowMat=new THREE.MeshLambertMaterial({color:0xfdd276,shading:THREE.FlatShading});var pinkMat=new THREE.MeshLambertMaterial({color:0xe0877e,shading:THREE.FlatShading});var redMat=new THREE.MeshLambertMaterial({color:0x630d15,shading:THREE.FlatShading});var whiteMat=new THREE.MeshLambertMaterial({color:0xffffff,shading:THREE.FlatShading});var blackMat=new THREE.MeshLambertMaterial({color:0x111111,shading:THREE.FlatShading});var brownMat=new THREE.MeshLambertMaterial({color:0x2e2019,shading:THREE.FlatShading});var lightBrownMat=new THREE.MeshLambertMaterial({color:0x664f4a,shading:THREE.FlatShading});this.handHeight=10;this.bodyHeight=80;this.armHeight=((this.bodyHeight*3/5)-this.handHeight)/2;this.faceHeight=30;this.shouldersPosition=new THREE.Vector3(0,this.armHeight*2+this.handHeight,0);this.isAttacking=false;this.isFootReplacing=false;this.isBlinking=false;this.footUsed="left";this.transferPower={x:0,y:0};this.body=new THREE.Group();var torsoGeom=new THREE.CylinderGeometry(0,26,this.bodyHeight,3,1);this.torso=new THREE.Mesh(torsoGeom,brownMat);this.torso.geometry.applyMatrix(new THREE.Matrix4().makeRotationY(Math.PI/3));this.torso.geometry.applyMatrix(new THREE.Matrix4().makeTranslation(0,-this.bodyHeight/2,0));var chestGeom=new THREE.CylinderGeometry(6,0,17,3);chestGeom.applyMatrix(new THREE.Matrix4().makeRotationY(Math.PI/3));chestGeom.applyMatrix(new THREE.Matrix4().makeScale(1,1,.3));this.ches.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0