phaser-arcade-physic模拟池塘放鱼自由游动及参数调节效果代码
代码语言:html
所属分类:动画
代码描述:phaser-arcade-physic模拟池塘放鱼自由游动及参数调节效果代码
代码标签: phaser-arcade-physic 模拟 池塘 放 鱼 自由 游动 参数 调节
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1024">
<style>
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
background: #111;
color: #eee;
font: caption;
}
#version {
position: absolute;
left: 0;
top: 0;
padding: 0;
background: rgba(0, 0, 0, 0.5)
}
</style>
</head>
<body >
<footer><div id=version></div></footer>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/phaser-arcade-physics.min.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/colors.1.2.0.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tweakpane.3.0.5.js"></script>
<script >
/* global colors, Phaser, Tweakpane */
const TIMESCALE = 1;
const ZOOM = 1;
const PHYSICS_STEPS_PER_SEC = 60;
const DEBUG = false;
const DEBUG_PHYSICS = false;
const options = {
alignWeight: 0.8,
cohereWeight: 0.4,
containRadius: 512,
containTime: 1,
containWeight: 0.6,
maxForce: 120,
maxSpeed: 60,
nearRange: 60,
quantity: 100,
separateRange: 15,
separateWeight: 0.2,
wanderRadius: 0.25,
wanderSpeed: 360,
wanderStrength: 0.5,
wanderWeight: 1
};
const debugOptions = {
acceleration: false,
align: true,
cohere: true,
contain: true,
nearRange: false,
separate: true,
separateRange: false,
velocity: false,
wander: true.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0