this repo has no description
1package;
2
3import flixel.FlxSprite;
4import flixel.system.FlxAssets.FlxGraphicAsset;
5import flixel.util.FlxColor;
6
7using flixel.util.FlxSpriteUtil;
8
9/**
10 * ...
11 * @author ninjaMuffin
12 */
13class MuzzleFlash extends FlxSprite
14{
15 private var lifeSpan:Int = 4;
16 private var counter:Int = 0;
17
18 public function new(?X:Float = 0, ?Y:Float = 0, ?SimpleGraphic:FlxGraphicAsset)
19 {
20 super(X, Y, SimpleGraphic);
21 makeGraphic(32, 32);
22 angle = 45;
23 }
24
25 override public function update(elapsed:Float):Void
26 {
27 super.update(elapsed);
28
29 counter += 1;
30 if (counter == 3)
31 {
32 color = FlxColor.BLACK;
33 alpha = 0.6;
34 }
35
36 if (counter >= lifeSpan)
37 {
38 kill();
39 }
40 }
41}