This commit is contained in:
Yoshman29
2022-11-05 04:00:28 +01:00
parent 1d7f163919
commit 51784fa0d1
36 changed files with 53 additions and 21 deletions
+2
View File
@@ -355,6 +355,7 @@ class PlayState extends MusicBeatState
boyfriend.dance();
var event:CountdownEvent = scripts.event("onCountdown", new CountdownEvent(
swagCounter,
introSprites[swagCounter],
introSounds[swagCounter],
1, 0.6, true));
@@ -370,6 +371,7 @@ class PlayState extends MusicBeatState
sprite = new FlxSprite().loadGraphic(spr);
sprite.scrollFactor.set();
sprite.scale.set(event.scale, event.scale);
sprite.updateHitbox();
sprite.screenCenter();
add(sprite);
+4 -12
View File
@@ -51,15 +51,10 @@ class Stage extends FlxBasic implements IBeatReceiver {
var spr = new StageSprite();
spr.antialiasing = true;
var addDefAnim = true;
if (!node.has.sprite || !node.has.name || !node.has.x || !node.has.y) continue;
if (Assets.exists(Paths.file('images/$spritesParentFolder${node.att.sprite}.xml', TEXT))) {
spr.frames = Paths.getSparrowAtlas('$spritesParentFolder${node.att.sprite}');
} else {
addDefAnim = false;
spr.loadGraphic(Paths.image('$spritesParentFolder${node.att.sprite}'));
}
spr.loadAnimatedGraphic(Paths.image('$spritesParentFolder${node.att.sprite}'));
var x:Null<Float> = Std.parseFloat(node.att.x);
var y:Null<Float> = Std.parseFloat(node.att.y);
if (x != null) spr.x = x;
@@ -77,6 +72,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (scroll != null) spr.scrollFactor.y = scroll;
}
}
if (node.has.antialiasing) spr.antialiasing = node.att.antialiasing == "true";
if (node.has.scale) {
var scale:Null<Float> = Std.parseFloat(node.att.scale);
if (scale != null) spr.scale.set(scale, scale);
@@ -84,7 +80,6 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (node.has.updateHitbox && node.att.updateHitbox == "true") spr.updateHitbox();
for(anim in node.nodes.anim) {
addDefAnim = false;
if (anim.has.name) spr.beatAnims.push(anim.att.name);
XMLUtil.addXMLAnimation(spr, anim);
}
@@ -92,9 +87,6 @@ class Stage extends FlxBasic implements IBeatReceiver {
if (node.has.anim) {
spr.animation.play(node.att.anim);
} else if (addDefAnim) {
spr.animation.addByPrefix("anim", "", 24, true);
spr.animation.play("anim");
}
stageSprites.set(node.att.name, spr);
@@ -44,8 +44,9 @@ class CountdownEvent extends CancellableEvent {
*/
public var sound:FlxSound;
public function new(spritePath:String, soundPath:String, scale:Float = 1, volume:Float = 1, antialiasing:Bool = true) {
public function new(swagCounter:Int, spritePath:String, soundPath:String, scale:Float = 1, volume:Float = 1, antialiasing:Bool = true) {
super();
this.swagCounter = swagCounter;
this.volume = volume;
this.soundPath = soundPath;
this.spritePath = spritePath;