optimize combos
This commit is contained in:
parent
6196046767
commit
19c49b0deb
@ -97,6 +97,9 @@ class PlayState extends MusicBeatState
|
|||||||
public static var sicks:Int = 0;
|
public static var sicks:Int = 0;
|
||||||
|
|
||||||
public static var songPosBG:FlxSprite;
|
public static var songPosBG:FlxSprite;
|
||||||
|
|
||||||
|
public var visibleCombos:Array<FlxSprite> = [];
|
||||||
|
|
||||||
public static var songPosBar:FlxBar;
|
public static var songPosBar:FlxBar;
|
||||||
|
|
||||||
public static var rep:Replay;
|
public static var rep:Replay;
|
||||||
@ -3733,14 +3736,33 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
add(numScore);
|
add(numScore);
|
||||||
|
|
||||||
|
visibleCombos.push(numScore);
|
||||||
|
|
||||||
FlxTween.tween(numScore, {alpha: 0}, 0.2, {
|
FlxTween.tween(numScore, {alpha: 0}, 0.2, {
|
||||||
onComplete: function(tween:FlxTween)
|
onComplete: function(tween:FlxTween)
|
||||||
{
|
{
|
||||||
|
visibleCombos.remove(numScore);
|
||||||
numScore.destroy();
|
numScore.destroy();
|
||||||
},
|
},
|
||||||
|
onUpdate: function (tween:FlxTween)
|
||||||
|
{
|
||||||
|
if (!visibleCombos.contains(numScore))
|
||||||
|
{
|
||||||
|
numScore.destroy();
|
||||||
|
tween.cancel();
|
||||||
|
}
|
||||||
|
},
|
||||||
startDelay: Conductor.crochet * 0.002
|
startDelay: Conductor.crochet * 0.002
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (visibleCombos.length > 25)
|
||||||
|
{
|
||||||
|
for(i in 0...seperatedScore.length - 1)
|
||||||
|
{
|
||||||
|
visibleCombos.remove(visibleCombos[visibleCombos.length - 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
daLoop++;
|
daLoop++;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user