HaxeFlixel / HaxeFlixel/flixel

FlxTween.cancelChain() doesn't function correctly if tween has completed

Open
#2,797 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

  • Haxe version: 4.2.4
  • Flixel version: 5.2.2
  • OpenFL version: 9.2.1
  • Lime version: 7.9.0
  • Affected targets:
    All

Code snippet reproducing the issue:
https://github.com/MondayHopscotch/TweenTest)https://github.com/MondayHopscotch/TweenTest


Reproduction steps:

  1. Create a tween with chained tweens (Tween.then(Tween))
  2. Save initial tween as variable (ex: var mainTween:FlxTween)
  3. After parent tween has completed, attempt to call mainTween.cancelChain()

Observed behavior:
Tween chain continues despite .cancelChain() being called on parent tween.

Expected behavior:
All tweens chained under parent tween are canceled.

In the case of my example project, expected behavior is that the square sprite stops tweening halfway through turning blue.

Extra Context:
https://discord.com/channels/162395145352904705/165234904815239168/1069465074219098122

This line is the culprit with how the current default manager operates:
https://github.com/HaxeFlixel/flixel/commit/b2436a63ccdb24f431088f06e5c4b06420126dde

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at FlxTween.cancelChain() and the default-manager behavior referenced by commit b2436a63ccdb24f431088f06e5c4b06420126dde. Reproduce the chained Tween.then() case from the linked example, then verify that calling cancelChain() after the parent completes stops all remaining chained tweens.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.