notesplash anim fixes (fidy!!!!)

This commit is contained in:
Yoshman29
2023-01-12 23:10:55 +01:00
parent 5f5393ca82
commit 3fc678dd2b
5 changed files with 29 additions and 25 deletions
+5 -9
View File
@@ -1,19 +1,15 @@
<!DOCTYPE codename-engine-splashes>
<splashes sprite="game/splashes/default" alpha="0.6">
<splashes sprite="game/splashes/default" alpha="0.6" scale="0.75">
<strum id="0"> <!-- LEFT -->
<anim name="splashleft1" anim="note impact 1 purple" fps="24" x="0" y="0" />
<anim name="splashleft2" anim="note impact 2 purple" fps="24" x="0" y="0" />
<anim name="splash purple" anim="splash purple" fps="24" x="0" y="0" />
</strum>
<strum id="1"> <!-- DOWN -->
<anim name="splashdown1" anim="note impact 1 blue" fps="24" x="0" y="0" />
<anim name="splashdown2" anim="note impact 2 blue" fps="24" x="0" y="0" />
<anim name="splash blue" anim="splash blue" fps="24" x="0" y="0" />
</strum>
<strum id="2"> <!-- UP -->
<anim name="splashup1" anim="note impact 1 green" fps="24" x="0" y="0" />
<anim name="splashup2" anim="note impact 2 green" fps="24" x="0" y="0" />
<anim name="splash green" anim="splash green" fps="24" x="0" y="0" />
</strum>
<strum id="3"> <!-- RIGHT -->
<anim name="splashright1" anim="note impact 1 red" fps="24" x="0" y="0" />
<anim name="splashright2" anim="note impact 2 red" fps="24" x="0" y="0" />
<anim name="splash red" anim="splash red" fps="24" x="0" y="0" />
</strum>
</splashes>
+1 -1
View File
@@ -1 +1 @@
2028
2031
+8 -6
View File
@@ -103,15 +103,17 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
return animationNames[id][FlxG.random.int(0, animationNames[id].length-1)];
}
var __splash:FunkinSprite;
public function showOnStrum(strum:Strum) {
if (!valid) return null;
var splash = recycle();
__splash = recycle();
splash.cameras = strum.lastDrawCameras;
splash.setPosition(strum.x + ((strum.width - splash.width) / 2), strum.y + ((strum.height - splash.height) / 2));
splash.active = splash.visible = true;
splash.playAnim(getSplashAnim(strum.ID), true);
__splash.cameras = strum.lastDrawCameras;
__splash.setPosition(strum.x + ((strum.width - __splash.width) / 2), strum.y + ((strum.height - __splash.height) / 2));
__splash.active = __splash.visible = true;
__splash.playAnim(getSplashAnim(strum.ID), true);
__splash.scrollFactor.set(strum.scrollFactor.x, strum.scrollFactor.y);
return splash;
return __splash;
}
}
+3 -2
View File
@@ -31,9 +31,10 @@ class SplashHandler extends FlxTypedGroup<FunkinSprite> {
grpMap = null;
}
var __grp:SplashGroup;
public function showSplash(name:String, strum:Strum) {
var grp = getSplashGroup(name);
add(grp.showOnStrum(strum));
__grp = getSplashGroup(name);
add(__grp.showOnStrum(strum));
// max 8 rendered splashes
while(members.length > 8)
+12 -7
View File
@@ -43,13 +43,18 @@ class FunkinSprite extends FlxSprite implements IBeatReceiver implements IOffset
public static function copyFrom(source:FunkinSprite) {
var spr = new FunkinSprite();
spr.setPosition(source.x, source.y);
spr.frames = source.frames;
if (source.animateAtlas != null && source.atlasPath != null)
spr.loadSprite(source.atlasPath);
spr.animation.copyFrom(source.animation);
spr.visible = source.visible;
spr.alpha = source.alpha;
@:privateAccess {
spr.setPosition(source.x, source.y);
spr.frames = source.frames;
if (source.animateAtlas != null && source.atlasPath != null)
spr.loadSprite(source.atlasPath);
spr.animation.copyFrom(source.animation);
spr.visible = source.visible;
spr.alpha = source.alpha;
spr.antialiasing = source.antialiasing;
spr.scale.set(source.scale.x, source.scale.y);
spr.scrollFactor.set(source.scrollFactor.x, source.scrollFactor.y);
}
return spr;
}