Timeline's complete event is triggered prematurely before tweens finish

オープン
#7,159 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript
領域
game-dev

調査の方向性

まず issue の JavaScript 例を実行し、ログに記録された順序と counter.x の値を比較します。次に、tween 周辺の Phaser Timeline の完了動作を追跡し、Timeline complete event が tween の onComplete コールバックの実行後かつ最終値に到達した後にのみ発火することを確認します。

索引モデルが issue の本文から書いたものです。

説明

Version

  • Phaser Version: 3.90.0
  • Operating System: macOS

Description

The Timeline's complete event is triggered before all its tweens have completed.

Example Test Code

class Example extends Phaser.Scene {
    constructor() {
        super();
    }

    preload() {}

    create() {
        const timeline = this.add.timeline();

        const counter = {
            x: 0
        };

        timeline.add({
            at: 0,
            run: () => {
                console.log("Start!");
            }
        });

        timeline.add({
            at: 100,
            tween: {
                targets: counter,
                duration: 3000,
                x: 1000,
                onComplete: () => {
                    console.log("Tween complete: counter.x =", counter.x);
                }
            }
        });

        timeline.on("complete", () => {
            console.log("Timeline complete: counter.x =", counter.x);
        });

        timeline.play();
    }
}

const game = new Phaser.Game({
    type: Phaser.WEBGL,
    parent: 'phaser-example',
    width: 800,
    height: 800,
    scene: Example
});

Expected Behavior

The Timeline's complete event should only be triggered after all tweens within the timeline have completed.

主要言語
JavaScript
スター
40.7k
フォーク
7.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phaserjs/phaser のほかの issue

phaserjs/phaser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。