-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add FlxTween.flicker #3086
add FlxTween.flicker #3086
Conversation
* The default tween function of flicker tweens | ||
* @param tween The tween handling the flickering | ||
*/ | ||
public static function defaultTweenFunction(tween:FlickerTween) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the functions here have explicit returns types on the signature. What is the flixel guideline for return types in function signatures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no rule on this, I kinda prefer not having it, in more cases, especially here where tweenFunction
is well defined
*/ | ||
public static function defaultTweenFunction(tween:FlickerTween) | ||
{ | ||
return (tween.time / tween.period) % 1 > tween.ratio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious how you approached handling the ratio. This is pleasantly simple 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at first I had > 0.5
then i wondered what other values would look like
FlxTween based flicker tool. FlxFlicker isn't being deprecated but I don't recommend using it unless someone has a good reason
additions and features:
flicker
,isFlickering
andstopFlickering
instance methods toFlxTweenManager
and static methods toFlxTween
ratio
: rather than 50-50 split of on/off, can do 80-20 or whateverTo do: add unit test