0
Spriteを水平方向に移動するこのメソッドはうまくいきますが、実際に後ろにエフェクトを追加する方法に困惑しています。私は動いている間にスプライトのプリントをキャンバスに残したい。Pixi.js(V4)を使用してスプライトに後行エフェクトを作成
はここ
private dash =() => {
let warriorLeftPosX = this.viking.x + this.viking.width;
let warriorRightPosX = this.mountainMan.x - this.mountainMan.width;
this.viking.vx = this.vikingProperties.sprite_loop_velocity;
this.mountainMan.vx = this.mountainManProperties.sprite_loop_velocity;
this.viking.accelerationX = this.vikingProperties.animation.dash.acceleration;
this.mountainMan.accelerationX = this.mountainManProperties.animation.dash.acceleration;
if (warriorRightPosX > this.renderer.view.width/2 - (this.mountainMan.width/6)
|| warriorLeftPosX < this.renderer.view.width/2 - (this.viking.width/6)) {
this.mountainMan.vx += this.mountainMan.accelerationX;
this.viking.vx += this.viking.accelerationX;
this.mountainMan.x -= this.mountainMan.vx;
this.viking.x += this.viking.vx;
}
}
この方法はで再帰を使用して実行されます(私は活字体を使用しています)私の現在のコードです。
おかげ
私は、これはキャンバスやWebGLのレンダラーをサポートするためにやっていた場合は
おもしろい!...今日は後で試してみるよ、叫び声をあげるよ –
すごくいいですね..ありがとう! –