package; import flixel.FlxSprite; import flixel.addons.effects.chainable.FlxEffectSprite; import flixel.addons.effects.chainable.FlxOutlineEffect; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup; import flixel.text.FlxText; import flixel.util.FlxColor; class Player extends FlxTypedSpriteGroup { var _effectSprite:FlxEffectSprite; var _outline:FlxOutlineEffect; public function new(x:Float = 0, y:Float = 0, name:String, sessionId:String) { super(x, y); var player = new FlxSprite(); player.loadGraphic("assets/images/player.png"); add(_effectSprite = new FlxEffectSprite(player)); if (sessionId != name) { _outline = new FlxOutlineEffect(FlxColor.RED, 2); _effectSprite.effects = [_outline]; } var text = new FlxText(0, 2, 0, name, 8); add(text); } }