common-game
Advanced tools
Comparing version 0.0.36 to 0.0.37
19
game.js
import PIXIUtils from './pixiUtils.js'; | ||
import Utils from './utils'; | ||
import TWEEN from './tween'; | ||
import Quadtree from './libs/quadtree';//四叉树 | ||
import { TweenMax } from './libs/greensock-js/src/esm/TweenMax';//补间动画 | ||
@@ -27,2 +29,19 @@ export default class Game { | ||
// 四叉树用法 | ||
quadTreeFun() { | ||
// 1.定义区域范围 | ||
this._tree = new Quadtree({ x: 0, y: 0, width: this.width, height: this.height }); | ||
// 2.四叉树清理 | ||
this._tree.clear(); | ||
// 3.新增 obj对象需要:x y width height属性 | ||
this._tree.insert(obj); | ||
// 4.查找指定范围的对象,返回数组 rect: {x,y,width,height} | ||
this._tree.retrieve(rect); | ||
} | ||
// 补间动画用法 | ||
tweenMaxFun() { | ||
TweenMax.to(target, 0.1, { x: p.x, y: p.y }) | ||
} | ||
renderPlayer() { | ||
@@ -29,0 +48,0 @@ let imgObj = Object.assign({ |
{ | ||
"name": "common-game", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "common-game.js", |
@@ -0,2 +1,7 @@ | ||
import Quadtree from './libs/quadtree';//四叉树 | ||
import { TweenMax } from './libs/greensock-js/src/esm/TweenMax';//补间动画 | ||
export default { | ||
Quadtree, | ||
TweenMax, | ||
audioFun: function (audioSrc, audioGlobalName) { | ||
@@ -3,0 +8,0 @@ if (!audioSrc) { return false; } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
1940863
86
34995
18
1