From 24a65a4a8ad1c1fd1f6fd989f94c901b93a8b07b Mon Sep 17 00:00:00 2001
From: "Rodney, An Imaginative Person"
<59747809+RodneyAnImaginativePerson@users.noreply.github.com>
Date: Mon, 26 Aug 2024 20:27:37 -0400
Subject: [PATCH] added "-loop" stuff (#278)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* added "-loop" stuff
* added loop anims to the chars
* added to mom and dad for their funny eye glow
* explanation
* Update da.xml
* slightly optimized and a lil better
* oops
this would have actually caused issues since the it would have take the reversed value from the animation before -loop
---------
Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
---
assets/data/characters/bf-car.xml | 24 +++++++++++++++---------
assets/data/characters/da.xml | 15 ++++++++++-----
assets/data/characters/dad.xml | 15 ++++++++++-----
assets/data/characters/mom-car.xml | 14 ++++++++++----
assets/data/characters/mom.xml | 16 +++++++++++-----
assets/images/characters/mom.xml | 5 +++--
source/funkin/backend/FunkinSprite.hx | 12 ++++++++++++
7 files changed, 71 insertions(+), 30 deletions(-)
diff --git a/assets/data/characters/bf-car.xml b/assets/data/characters/bf-car.xml
index b4c9b24c..bd276ca8 100644
--- a/assets/data/characters/bf-car.xml
+++ b/assets/data/characters/bf-car.xml
@@ -1,12 +1,18 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/data/characters/da.xml b/assets/data/characters/da.xml
index 2ef057ba..f176be02 100644
--- a/assets/data/characters/da.xml
+++ b/assets/data/characters/da.xml
@@ -1,8 +1,13 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/data/characters/dad.xml b/assets/data/characters/dad.xml
index 1b1e0f04..39319727 100644
--- a/assets/data/characters/dad.xml
+++ b/assets/data/characters/dad.xml
@@ -1,8 +1,13 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/data/characters/mom-car.xml b/assets/data/characters/mom-car.xml
index fa7c18dd..e511498f 100644
--- a/assets/data/characters/mom-car.xml
+++ b/assets/data/characters/mom-car.xml
@@ -1,10 +1,16 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/data/characters/mom.xml b/assets/data/characters/mom.xml
index 4781ede4..43d52076 100644
--- a/assets/data/characters/mom.xml
+++ b/assets/data/characters/mom.xml
@@ -1,10 +1,16 @@
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/images/characters/mom.xml b/assets/images/characters/mom.xml
index 67eeb6b7..51132b97 100644
--- a/assets/images/characters/mom.xml
+++ b/assets/images/characters/mom.xml
@@ -15,8 +15,9 @@
-
-
+
+
diff --git a/source/funkin/backend/FunkinSprite.hx b/source/funkin/backend/FunkinSprite.hx
index 63f6a8b7..1dde08cd 100644
--- a/source/funkin/backend/FunkinSprite.hx
+++ b/source/funkin/backend/FunkinSprite.hx
@@ -94,6 +94,14 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
public override function update(elapsed:Float)
{
super.update(elapsed);
+
+ // hate how it looks like but hey at least its optimized and fast - Nex
+ if (isAnimFinished()) {
+ var name = getAnimName() + '-loop';
+ if (animation.exists(name))
+ playAnim(name, false, lastAnimContext);
+ }
+
if (animateAtlas != null)
animateAtlas.update(elapsed);
}
@@ -337,6 +345,10 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
return name;
}
+ public inline function isAnimReversed():Bool {
+ return animateAtlas != null ? animateAtlas.anim.reversed : animation.curAnim != null ? animation.curAnim.reversed : false;
+ }
+
public inline function removeAnimation(name:String) {
if (animateAtlas != null)
@:privateAccess animateAtlas.anim.animsMap.remove(name);