1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-11-28 15:26:12 +00:00

Add hmm flxanimate, new conditional for Cheems' PC sake and more wip char select animation

This commit is contained in:
CheemsAndFriends 2024-09-07 02:07:00 +02:00
parent a901677853
commit f3722e5da2
5 changed files with 62 additions and 47 deletions

2
assets

@ -1 +1 @@
Subproject commit f73c8f4798bfcd23c98db03bcde2e0afcbce4cfd
Subproject commit d2ea072f32d0ba74cf8c62576f28e7b03d591ddb

View file

@ -46,7 +46,7 @@
"name": "flxanimate",
"type": "git",
"dir": null,
"ref": "27a0a1f0afc1074f619991472fb3ee209aad28df",
"ref": "280d1a46ac60021d08bb18181631cbd6d061782c",
"url": "https://github.com/Dot-Stuff/flxanimate"
},
{
@ -205,4 +205,4 @@
"url": "https://github.com/fponticelli/thx.semver"
}
]
}
}

View file

@ -22,7 +22,7 @@ class Main extends Sprite
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
var initialState:Class<FlxState> = funkin.InitState; // The FlxState the game starts with.
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
#if web
#if (web || CHEEMS)
var framerate:Int = 60; // How many frames per second the game should run at.
#else
// TODO: This should probably be in the options menu?

View file

@ -78,6 +78,7 @@ class CharSelectSubState extends MusicBeatSubState
var selectTimer:FlxTimer = new FlxTimer();
var selectSound:FunkinSound;
var unlockSound:FunkinSound;
var charSelectCam:FunkinCamera;
@ -270,6 +271,20 @@ class CharSelectSubState extends MusicBeatSubState
grpCursors.add(cursorBlue);
grpCursors.add(cursor);
selectSound = new FunkinSound();
selectSound.loadEmbedded(Paths.sound('CS_select'));
selectSound.pitch = 1;
selectSound.volume = 0.7;
FlxG.sound.defaultSoundGroup.add(selectSound);
unlockSound = new FunkinSound();
unlockSound.loadEmbedded(Paths.sound('CS_unlock'));
unlockSound.pitch = 1;
unlockSound.volume = 0.7;
FlxG.sound.defaultSoundGroup.add(unlockSound);
initLocks();
for (index => member in grpIcons.members)
@ -301,13 +316,6 @@ class CharSelectSubState extends MusicBeatSubState
add(temp);
temp.alpha = 0.0;
selectSound = new FunkinSound();
selectSound.loadEmbedded(Paths.sound('CS_select'));
selectSound.pitch = 1;
selectSound.volume = 0.7;
FlxG.sound.defaultSoundGroup.add(selectSound);
Conductor.stepHit.add(spamOnStep);
// FlxG.debugger.track(temp, "tempBG");
@ -394,58 +402,66 @@ class CharSelectSubState extends MusicBeatSubState
var copy = 3;
var yThing = 0;
var yThing = -1;
while (index > copy)
while ((index + 1) > copy)
{
yThing++;
copy += 3;
}
var xThing = copy - index - 1;
var xThing = (copy - index - 2) * -1;
// Look, I'd write better code but I had better aneurysms, my bad - Cheems
cursorY = yThing;
cursorX = xThing;
cursorY = 3 - yThing;
cursorX = 3 - xThing;
selectSound.play(true);
nonLocks.shift();
selectTimer.start(1, function(_) {
var lock:Lock = cast grpIcons.group.members[index];
lock.anim.getFrameLabel("unlockAnim").add(function() {
playerChillOut.playAnimation("death");
});
lock.playAnimation("unlock");
unlockSound.play(true);
lock.onAnimationComplete.addOnce(function(_) {
camera.flash(0xFFFFFFFF, 0.1);
playerChill.playAnimation("unlock");
playerChill.visible = true;
if (nonLocks.length == 0)
{
FunkinSound.playMusic('stayFunky',
{
startingVolume: 1,
overrideExisting: true,
restartTrack: true,
onLoad: function() {
@:privateAccess
gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1);
#if desktop
// On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5
// So we want to manually change it!
@:privateAccess
gfChill.analyzer.fftN = 512;
#end
}
});
}
else
playerChill.onAnimationComplete.addOnce((_) -> unLock());
});
playerChill.visible = false;
playerChill.switchChar(availableChars[index]);
playerChillOut.visible = true;
playerChillOut.playAnimation("death");
playerChillOut.onAnimationComplete.addOnce((_) -> if (_ == "death")
{
playerChill.playAnimation("unlock");
playerChill.onAnimationComplete.addOnce(function(_) {
nonLocks.shift();
if (nonLocks.length > 0) unLock();
else
{
FunkinSound.playMusic('stayFunky',
{
startingVolume: 1,
overrideExisting: true,
restartTrack: true,
onLoad: function() {
@:privateAccess
gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1);
#if desktop
// On desktop it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5
// So we want to manually change it!
@:privateAccess
gfChill.analyzer.fftN = 512;
#end
}
});
}
});
playerChill.visible = true;
});
});
}

View file

@ -20,7 +20,6 @@ class Lock extends FlxAtlasSprite
var arr:Array<String> = ["lock", "lock top 1", "lock top 2", "lock top 3", "lock base fuck it"];
onAnimationComplete.add((_) -> if (_ == "unlock") playAnimation("idle"));
var func = function(name) {
var symbol = anim.symbolDictionary[name];
if (symbol != null && symbol.timeline.get("color") != null) symbol.timeline.get("color").get(0).colorEffect = tint;