Commit bff51715 authored by haiyoucuv's avatar haiyoucuv

init

parent 1fa0adc5
......@@ -462,7 +462,7 @@ export class Snake extends Component {
this.accEffectNode.active = true;
const count = this.bodyArr.length / 2 >> 0;
const count = this.bodyArr.length / 4 >> 0;
for (let i = this.accEffectArr.length - 1; i < count; i++) {
const accEffect = accEffectPool.get() || instantiate(this.accEffectPrefab);
this.accEffectNode.addChild(accEffect);
......@@ -477,7 +477,7 @@ export class Snake extends Component {
const len = this.accEffectArr.length;
for (let i = 1; i < len; i++) {
const node = this.accEffectArr[i];
const body = this.bodyArr[i * 2 - 1];
const body = this.bodyArr[i * 4 - 1];
node.setPosition(body.position);
node.angle = body.angle;
node.setScale(this.scale, this.scale);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment