1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-15 11:22:55 +00:00

assets submod

This commit is contained in:
Cameron Taylor 2024-07-04 15:06:04 -04:00
commit 130440fd6e
7 changed files with 69 additions and 32 deletions

2
assets

@ -1 +1 @@
Subproject commit 9050732ec1cc69cbca9a9a73ee817459f84bdc53
Subproject commit 8d5bc0dce1e0cb4f545037ce4040e7a5f2d85871

View file

@ -11,7 +11,6 @@ class MenuItem extends FlxSpriteGroup
{
public var targetY:Float = 0;
public var week:FlxSprite;
public var flashingInt:Int = 0;
public function new(x:Float, y:Float, weekNum:Int = 0, weekType:WeekType)
{
@ -30,28 +29,28 @@ class MenuItem extends FlxSpriteGroup
}
var isFlashing:Bool = false;
var flashTick:Float = 0;
final flashFramerate:Float = 20;
public function startFlashing():Void
{
isFlashing = true;
}
// if it runs at 60fps, fake framerate will be 6
// if it runs at 144 fps, fake framerate will be like 14, and will update the graphic every 0.016666 * 3 seconds still???
// so it runs basically every so many seconds, not dependant on framerate??
// I'm still learning how math works thanks whoever is reading this lol
var fakeFramerate:Int = Math.round((1 / FlxG.elapsed) / 10);
override function update(elapsed:Float)
{
super.update(elapsed);
y = MathUtil.coolLerp(y, (targetY * 120) + 480, 0.17);
if (isFlashing) flashingInt += 1;
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2)) week.color = 0xFF33ffff;
else
week.color = FlxColor.WHITE;
if (isFlashing)
{
flashTick += elapsed;
if (flashTick >= 1 / flashFramerate)
{
flashTick %= 1 / flashFramerate;
week.color = (week.color == FlxColor.WHITE) ? 0xFF33ffff : FlxColor.WHITE;
}
}
}
}

View file

@ -214,7 +214,7 @@ class FreeplayState extends MusicBeatSubState
prepForNewRank = true;
}
if (stickers != null)
if (stickers?.members != null)
{
stickerSubState = stickers;
}
@ -1738,7 +1738,7 @@ class FreeplayState extends MusicBeatSubState
dj.confirm();
grpCapsules.members[curSelected].forcePosition();
grpCapsules.members[curSelected].songText.flickerText();
grpCapsules.members[curSelected].confirm();
// FlxTween.color(bgDad, 0.33, 0xFFFFFFFF, 0xFF555555, {ease: FlxEase.quadOut});
FlxTween.color(pinkBack, 0.33, 0xFFFFD0D5, 0xFF171831, {ease: FlxEase.quadOut});
@ -2039,6 +2039,8 @@ class FreeplaySongData
function set_currentDifficulty(value:String):String
{
if (currentDifficulty == value) return value;
currentDifficulty = value;
updateValues(displayedVariations);
return value;

View file

@ -543,8 +543,6 @@ class SongMenuItem extends FlxSpriteGroup
charPath += 'monsterpixel';
case 'mom-car':
charPath += 'mommypixel';
case 'dad':
charPath += 'daddypixel';
case 'darnell-blazin':
charPath += 'darnellpixel';
case 'senpai-angry':
@ -559,7 +557,17 @@ class SongMenuItem extends FlxSpriteGroup
return;
}
pixelIcon.loadGraphic(Paths.image(charPath));
var isAnimated = openfl.utils.Assets.exists(Paths.file('images/$charPath.xml'));
if (isAnimated)
{
pixelIcon.frames = Paths.getSparrowAtlas(charPath);
}
else
{
pixelIcon.loadGraphic(Paths.image(charPath));
}
pixelIcon.scale.x = pixelIcon.scale.y = 2;
switch (char)
@ -571,6 +579,22 @@ class SongMenuItem extends FlxSpriteGroup
}
// pixelIcon.origin.x = capsule.origin.x;
// pixelIcon.offset.x -= pixelIcon.origin.x;
if (isAnimated)
{
pixelIcon.active = true;
pixelIcon.animation.addByPrefix('idle', 'idle0', 10, true);
pixelIcon.animation.addByPrefix('confirm', 'confirm0', 10, false);
pixelIcon.animation.addByPrefix('confirm-hold', 'confirm-hold0', 10, true);
pixelIcon.animation.finishCallback = function(name:String):Void {
trace('Finish pixel animation: ${name}');
if (name == 'confirm') pixelIcon.animation.play('confirm-hold');
};
pixelIcon.animation.play('idle');
}
}
var frameInTicker:Float = 0;
@ -711,6 +735,18 @@ class SongMenuItem extends FlxSpriteGroup
super.update(elapsed);
}
/**
* Play any animations associated with selecting this song.
*/
public function confirm():Void
{
if (songText != null) songText.flickerText();
if (pixelIcon != null)
{
pixelIcon.animation.play('confirm');
}
}
public function intendedY(index:Int):Float
{
return (index * ((height * realScaled) + 10)) + 120;

View file

@ -13,13 +13,10 @@ class LevelTitle extends FlxSpriteGroup
public final level:Level;
public var targetY:Float;
public var isFlashing:Bool = false;
var title:FlxSprite;
var lock:FlxSprite;
var flashingInt:Int = 0;
public function new(x:Int, y:Int, level:Level)
{
super(x, y);
@ -46,20 +43,23 @@ class LevelTitle extends FlxSpriteGroup
}
}
// if it runs at 60fps, fake framerate will be 6
// if it runs at 144 fps, fake framerate will be like 14, and will update the graphic every 0.016666 * 3 seconds still???
// so it runs basically every so many seconds, not dependant on framerate??
// I'm still learning how math works thanks whoever is reading this lol
var fakeFramerate:Int = Math.round((1 / FlxG.elapsed) / 10);
public var isFlashing:Bool = false;
var flashTick:Float = 0;
final flashFramerate:Float = 20;
public override function update(elapsed:Float):Void
{
this.y = MathUtil.coolLerp(y, targetY, 0.17);
if (isFlashing) flashingInt += 1;
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2)) title.color = 0xFF33ffff;
else
title.color = FlxColor.WHITE;
if (isFlashing)
{
flashTick += elapsed;
if (flashTick >= 1 / flashFramerate)
{
flashTick %= 1 / flashFramerate;
title.color = (title.color == FlxColor.WHITE) ? 0xFF33ffff : FlxColor.WHITE;
}
}
}
public function showLock():Void

View file

@ -113,7 +113,7 @@ class StoryMenuState extends MusicBeatState
{
super();
if (stickers != null)
if (stickers?.members != null)
{
stickerSubState = stickers;
}

View file

@ -346,7 +346,7 @@ class LoadingState extends MusicBeatSubState
return 'Done precaching ${path}';
}, true);
trace("Queued ${path} for precaching");
trace('Queued ${path} for precaching');
// FunkinSprite.cacheTexture(path);
}