pretty much a copy of FlxFlicker geared towards making sprites shake around at a set interval and slow down over time.

Static methods

staticisShaking(Object:FlxObject):Bool

Returns whether the object is shaking or not.

Parameters:

Object

The object to test.

@:value({ EndIntensity : 0, StartIntensity : 0, Interval : 0.04, Duration : 1 })staticshake(Object:FlxObject, Duration:Float = 1, Interval:Float = 0.04, StartIntensity:Float = 0, EndIntensity:Float = 0, Ease:EaseFunction, ?CompletionCallback:IntervalShake ‑> Void, ?ProgressCallback:IntervalShake ‑> Void):IntervalShake

An effect that shakes the sprite on a set interval and a starting intensity that goes down over time.

Parameters:

Object

The object to shake.

Duration

How long to shake for (in seconds). 0 means "forever".

Interval

In what interval to update the shake position. Set to FlxG.elapsed if <= 0!

StartIntensity

The starting intensity of the shake.

EndIntensity

The ending intensity of the shake.

Ease

Control the easing of the intensity over the shake.

CompletionCallback

Callback on shake completion

ProgressCallback

Callback on each shake interval

Returns:

The IntervalShake object. IntervalShakes are pooled internally, so beware of storing references.

staticstopShaking(Object:FlxObject):Void

Stops shaking the object.

Parameters:

Object

The object to stop shaking.

Variables

@:value(0)read only_secondsSinceStart:Float = 0

read onlyaxes:FlxAxes

Defines on what axes to shake(). Default value is XY / both.

read onlyduration:Float

How long to shake for (in seconds). 0 means "forever".

read onlyease:EaseFunction

The easing of the intensity over the shake.

read onlyendIntensity:Float

The ending intensity of the shake.

read onlyinitialOffset:FlxPoint

Defines the initial position of the object at the beginning of the shake effect.

read onlyinterval:Float

The interval of the shake.

read onlyobject:FlxObject

The shaking object.

@:value(0)read onlyscale:Float = 0

read onlystartIntensity:Float

The starting intensity of the shake.

read onlytimer:FlxTimer

The shaking timer. You can check how many seconds has passed since shaking started etc.

read onlycompletionCallback:IntervalShake ‑> Void

The callback that will be triggered after the shake has completed.

read onlyprogressCallback:IntervalShake ‑> Void

The callback that will be triggered every time the object shakes.

Methods

destroy():Void

Nullifies the references to prepare object for reuse and avoid memory leaks.

stop():Void

Prematurely ends shaking.