HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.99k stars 439 forks source link

Remove FlxTween - replace with Actuate lib #538

Closed gamedevsam closed 11 years ago

gamedevsam commented 11 years ago

Actuate lib is easy to use and good on performance. It also has nice documentation. We should update tweening demo to use Actuate lib, and probably add an entry on the HaxeFlixel wiki that describes how to use the lib.

gamedevsam commented 11 years ago

Should probably profile the difference between using Actuator and FlxTweens - for single var tween and multi var tween.

AndreiRegiani commented 11 years ago

I'm okay with this if API does not change (for game code compatibility).

gamedevsam commented 11 years ago

I will propose we completely remove all FlxTween classes if the community agrees to support Actuate. This would break support for those that use FlxTweens, but it should be very easy to switch, actuate provides great ease of use.

AndreiRegiani commented 11 years ago

Users would use Actuate directly? what do you think of creating a class that use Actuate internally? Could keep the name FlxTween. Also, there could be static functions for fast use of tweens, example:

FlxTween.angle(sprite, 0, 360, 1.0, Ease.quadInOut);

Sucks to create objects each time for each tween.

goshki commented 11 years ago

There's one big caveat regarding using Actuate with HaxeFlixel: Actuate updates all tweens on each ENTER_FRAME event, so it's totally independent of HaxeFlixel's update system. It means that it's really hard to have fine-grained control over which tweens should update (for example when some tweens should pause while others should continue). Actuate is also totally unaware of HaxeFlixel's time scale. 26 lip 2013 22:49, "Samuel Batista" notifications@github.com napisa³(a):

Actuate lib is easy to use and good on performance. It also has nice documentation http://haxe.org/com/libs/actuate. We should update tweening demo to use Actuate lib, and probably add an entry on the HaxeFlixel wiki that describes how to use the lib.

Reply to this email directly or view it on GitHubhttps://github.com/HaxeFlixel/flixel/issues/538 .

gamedevsam commented 11 years ago

I agree, FlxTween has some strong benefits because it's so tightly integrated with Flixel. Closing this for now.

MintPaw commented 8 years ago

I'd like this to be reconsidered. Yes Actuate is unaware of HaxeFlixel's timescale, but that's probably pretty easily fixed by creating a custom actuator.

I recently tried to make an FlxTween un-aware of timescale in this thread. And in doing so I've come to realize how much of a mess FlxTween is, I can't even seem to tween FlxG.timescale or any static values right now do to some reflection problem, and starting multiple tweens with delays doesn't seem to work in some hard to reproduce situations.

There's open feature request for grouping of tweens and bounties on mass killing of tweens. This is why we had TweenMax despite fl.transitions.Tween and Actuate is completely factored out of OpenFL, tweening is really tough and needs some real attentions to work properly. In my opinion FlxTween should just interface with Actuate in the background.