aboutsummaryrefslogtreecommitdiff
path: root/source/Player.hx
diff options
context:
space:
mode:
Diffstat (limited to 'source/Player.hx')
-rw-r--r--source/Player.hx23
1 files changed, 20 insertions, 3 deletions
diff --git a/source/Player.hx b/source/Player.hx
index 80c3f78..2aba60c 100644
--- a/source/Player.hx
+++ b/source/Player.hx
@@ -1,13 +1,30 @@
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 FlxSprite
+class Player extends FlxTypedSpriteGroup<FlxSprite>
{
- public function new(x:Float = 0, y:Float = 0)
+ var _effectSprite:FlxEffectSprite;
+ var _outline:FlxOutlineEffect;
+
+ public function new(x:Float = 0, y:Float = 0, name:String, sessionId:String)
{
super(x, y);
- loadGraphic("assets/images/player.png");
+ 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);
}
}