2020-12-27 08:13:51 +00:00
|
|
|
package;
|
|
|
|
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
import flixel.graphics.frames.FlxAtlasFrames;
|
|
|
|
|
|
|
|
class BackgroundDancer extends FlxSprite
|
|
|
|
{
|
|
|
|
public function new(x:Float, y:Float)
|
|
|
|
{
|
|
|
|
super(x, y);
|
|
|
|
|
2021-02-08 21:34:48 +00:00
|
|
|
frames = Paths.getSparrowAtlas("limo/limoDancer");
|
2020-12-27 08:13:51 +00:00
|
|
|
animation.addByIndices('danceLeft', 'bg dancer sketch PINK', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
|
|
|
animation.addByIndices('danceRight', 'bg dancer sketch PINK', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
|
|
|
animation.play('danceLeft');
|
2021-03-19 17:13:41 +00:00
|
|
|
animation.finish();
|
2020-12-27 08:13:51 +00:00
|
|
|
antialiasing = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
var danceDir:Bool = false;
|
|
|
|
|
|
|
|
public function dance():Void
|
|
|
|
{
|
|
|
|
danceDir = !danceDir;
|
|
|
|
|
|
|
|
if (danceDir)
|
|
|
|
animation.play('danceRight', true);
|
|
|
|
else
|
|
|
|
animation.play('danceLeft', true);
|
|
|
|
}
|
|
|
|
}
|