mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-05 06:14:36 +00:00
boyfriend animations swapped to atlas sprites
This commit is contained in:
parent
f000d21689
commit
5ddc4876bc
2
art
2
art
|
@ -1 +1 @@
|
|||
Subproject commit e8d96feb8af616f360e68538b7347fae84d8308f
|
||||
Subproject commit 769b84ffd7550b18fb3719cf4cb6b48296bdd097
|
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit 20553cc4687ec975427b37eda80e74e381d9a2ef
|
||||
Subproject commit 2d4cd85129db9aea8cdba62ef43313f99f13c857
|
|
@ -200,8 +200,6 @@ class FreeplayState extends MusicBeatSubState
|
|||
moreWays.speed = 6.8;
|
||||
grpTxtScrolls.add(moreWays);
|
||||
|
||||
FlxG.debugger.track(moreWays, "HotBlooded 1");
|
||||
|
||||
exitMovers.set([moreWays],
|
||||
{
|
||||
x: FlxG.width * 2,
|
||||
|
@ -212,7 +210,6 @@ class FreeplayState extends MusicBeatSubState
|
|||
funnyScroll.funnyColor = 0xFFff9963;
|
||||
funnyScroll.speed = -3.8;
|
||||
grpTxtScrolls.add(funnyScroll);
|
||||
FlxG.debugger.track(funnyScroll, "Boyfriend 1");
|
||||
|
||||
exitMovers.set([funnyScroll],
|
||||
{
|
||||
|
@ -230,13 +227,11 @@ class FreeplayState extends MusicBeatSubState
|
|||
x: FlxG.width * 2,
|
||||
speed: 0.4,
|
||||
});
|
||||
FlxG.debugger.track(txtNuts, "Protect yo nuts 1");
|
||||
|
||||
var funnyScroll2:BGScrollingText = new BGScrollingText(0, 335, "BOYFRIEND", FlxG.width / 2, false, 60);
|
||||
funnyScroll2.funnyColor = 0xFFff9963;
|
||||
funnyScroll2.speed = -3.8;
|
||||
grpTxtScrolls.add(funnyScroll2);
|
||||
FlxG.debugger.track(funnyScroll2, "Boyfriend 2");
|
||||
|
||||
exitMovers.set([funnyScroll2],
|
||||
{
|
||||
|
@ -248,7 +243,6 @@ class FreeplayState extends MusicBeatSubState
|
|||
moreWays2.funnyColor = 0xFFfff383;
|
||||
moreWays2.speed = 6.8;
|
||||
grpTxtScrolls.add(moreWays2);
|
||||
FlxG.debugger.track(moreWays2, "HotBlooded 2");
|
||||
|
||||
exitMovers.set([moreWays2],
|
||||
{
|
||||
|
@ -260,7 +254,6 @@ class FreeplayState extends MusicBeatSubState
|
|||
funnyScroll3.funnyColor = 0xFFfea400;
|
||||
funnyScroll3.speed = -3.8;
|
||||
grpTxtScrolls.add(funnyScroll3);
|
||||
FlxG.debugger.track(funnyScroll3, "Boyfriend 3");
|
||||
|
||||
exitMovers.set([funnyScroll3],
|
||||
{
|
||||
|
@ -268,7 +261,8 @@ class FreeplayState extends MusicBeatSubState
|
|||
speed: 0.3
|
||||
});
|
||||
|
||||
dj = new DJBoyfriend(0, -100);
|
||||
// dj = new DJBoyfriend(0, -100);
|
||||
dj = new DJBoyfriend(640, 366);
|
||||
exitMovers.set([dj],
|
||||
{
|
||||
x: -dj.width * 1.6,
|
||||
|
@ -568,9 +562,6 @@ class FreeplayState extends MusicBeatSubState
|
|||
|
||||
var hsvShader:HSVShader = new HSVShader();
|
||||
|
||||
FlxG.debugger.addTrackerProfile(new TrackerProfile(HSVShader, ["hue", "saturation", "value"]));
|
||||
FlxG.debugger.track(hsvShader, "capsule shader");
|
||||
|
||||
var randomCapsule:SongMenuItem = grpCapsules.recycle(SongMenuItem);
|
||||
randomCapsule.init(FlxG.width, 0, "Random");
|
||||
randomCapsule.onConfirm = function() {
|
||||
|
|
|
@ -3,8 +3,9 @@ package funkin.freeplayStuff;
|
|||
import flixel.FlxSprite;
|
||||
import flixel.util.FlxSignal;
|
||||
import funkin.util.assets.FlxAnimationUtil;
|
||||
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
||||
|
||||
class DJBoyfriend extends FlxSprite
|
||||
class DJBoyfriend extends FlxAtlasSprite
|
||||
{
|
||||
// Represents the sprite's current status.
|
||||
// Without state machines I would have driven myself crazy years ago.
|
||||
|
@ -27,13 +28,31 @@ class DJBoyfriend extends FlxSprite
|
|||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super(x, y);
|
||||
super(x, y, Paths.animateAtlas("freeplay/freeplay-boyfriend", "preload"));
|
||||
|
||||
animOffsets = new Map<String, Array<Dynamic>>();
|
||||
|
||||
setupAnimations();
|
||||
trace(listAnimations());
|
||||
|
||||
animation.finishCallback = onFinishAnim;
|
||||
FlxG.debugger.track(this);
|
||||
|
||||
anim.onComplete = onFinishAnim;
|
||||
}
|
||||
|
||||
/*
|
||||
[remote hand under,boyfriend top head,brim piece,arm cringe l,red lazer,dj arm in,bf fist pump arm,hand raised right,forearm left,fist shaking,bf smile eyes closed face,arm cringe r,bf clenched face,face shrug,boyfriend falling,blue tint 1,shirt sleeve,bf clenched fist,head BF relaxed,blue tint 2,hand down left,blue tint 3,blue tint 4,head less smooshed,blue tint 5,boyfriend freeplay,BF head slight turn,blue tint 6,arm shrug l,blue tint 7,shoulder raised w sleeve,blue tint 8,fist pump face,blue tint 9,foot rested light,hand turnaround,arm chill right,Boyfriend DJ,arm shrug r,head back bf,hat top piece,dad bod,face surprise snap,Boyfriend DJ fist pump,office chair,foot rested right,chest down,office chair upright,body chill,bf dj afk,head mouth open dad,BF Head defalt HAIR BLOWING,hand shrug l,face piece,foot wag,turn table,shoulder up left,turntable lights,boyfriend dj body shirt blowing,body chunk turned,hand down right,dj arm out,hand shrug r,body chest out,rave hand,palm,chill face default,head back semi bf,boyfriend bottom head,DJ arm,shoulder right dad,bf surprise,boyfriend dj body,hs1,Boyfriend DJ watchin tv OG,spinning disk,hs2,arm chill left,boyfriend dj intro,hs3,hs4,chill face extra,hs5,remote hand upright,hs6,pant over table,face surprise,bf arm peace,arm turnaround,bf eyes 1,arm slammed table,eye squit,leg BF,head mid piece,arm backing,arm swoopin in,shoe right lowering,forearm right,hand out,blue tint 10,body falling back,remote thumb press,shoulder,hair spike single,bf bent
|
||||
arm,crt,foot raised right,dad hand,chill face 1,chill face 2,clenched fist,head SMOOSHED,shoulder left dad,df1,body chunk upright,df2,df3,df4,hat front piece,df5,foot rested right 2,hand in,arm spun,shoe raised left,bf 1 finger hand,bf mouth 1,Boyfriend DJ confirm,forearm down ,hand raised left,remote thumb up]
|
||||
*/
|
||||
override public function listAnimations():Array<String>
|
||||
{
|
||||
var anims:Array<String> = [];
|
||||
@:privateAccess
|
||||
for (animKey in anim.symbolDictionary)
|
||||
{
|
||||
anims.push(animKey.name);
|
||||
}
|
||||
return anims;
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float):Void
|
||||
|
@ -44,11 +63,11 @@ class DJBoyfriend extends FlxSprite
|
|||
{
|
||||
case Intro:
|
||||
// Play the intro animation then leave this state immediately.
|
||||
if (getCurrentAnimation() != 'intro') playAnimation('intro', true);
|
||||
if (getCurrentAnimation() != 'boyfriend dj intro') playFlashAnimation('boyfriend dj intro', true);
|
||||
timeSinceSpook = 0;
|
||||
case Idle:
|
||||
// We are in this state the majority of the time.
|
||||
if (getCurrentAnimation() != 'idle' || animation.finished)
|
||||
if (getCurrentAnimation() != 'Boyfriend DJ' || anim.finished)
|
||||
{
|
||||
if (timeSinceSpook > SPOOK_PERIOD)
|
||||
{
|
||||
|
@ -56,18 +75,18 @@ class DJBoyfriend extends FlxSprite
|
|||
}
|
||||
else
|
||||
{
|
||||
playAnimation('idle', false);
|
||||
playFlashAnimation('Boyfriend DJ', false);
|
||||
}
|
||||
}
|
||||
timeSinceSpook += elapsed;
|
||||
case Confirm:
|
||||
if (getCurrentAnimation() != 'confirm') playAnimation('confirm', false);
|
||||
if (getCurrentAnimation() != 'Boyfriend DJ confirm') playFlashAnimation('Boyfriend DJ confirm', false);
|
||||
timeSinceSpook = 0;
|
||||
case Spook:
|
||||
if (getCurrentAnimation() != 'spook')
|
||||
if (getCurrentAnimation() != 'bf dj afk')
|
||||
{
|
||||
onSpook.dispatch();
|
||||
playAnimation('spook', false);
|
||||
playFlashAnimation('bf dj afk', false);
|
||||
}
|
||||
timeSinceSpook = 0;
|
||||
default:
|
||||
|
@ -75,20 +94,21 @@ class DJBoyfriend extends FlxSprite
|
|||
}
|
||||
}
|
||||
|
||||
function onFinishAnim(name:String):Void
|
||||
function onFinishAnim():Void
|
||||
{
|
||||
var name = anim.curSymbol.name;
|
||||
switch (name)
|
||||
{
|
||||
case "intro":
|
||||
case "boyfriend dj intro":
|
||||
// trace('Finished intro');
|
||||
currentState = Idle;
|
||||
onIntroDone.dispatch();
|
||||
case "idle":
|
||||
case "Boyfriend DJ":
|
||||
// trace('Finished idle');
|
||||
case "spook":
|
||||
case "bf dj afk":
|
||||
// trace('Finished spook');
|
||||
currentState = Idle;
|
||||
case "confirm":
|
||||
case "Boyfriend DJ confirm":
|
||||
// trace('Finished confirm');
|
||||
}
|
||||
}
|
||||
|
@ -100,19 +120,19 @@ class DJBoyfriend extends FlxSprite
|
|||
|
||||
function setupAnimations():Void
|
||||
{
|
||||
frames = FlxAnimationUtil.combineFramesCollections(Paths.getSparrowAtlas('freeplay/bfFreeplay'), Paths.getSparrowAtlas('freeplay/bf-freeplay-afk'));
|
||||
// frames = FlxAnimationUtil.combineFramesCollections(Paths.getSparrowAtlas('freeplay/bfFreeplay'), Paths.getSparrowAtlas('freeplay/bf-freeplay-afk'));
|
||||
|
||||
animation.addByPrefix('intro', "boyfriend dj intro", 24, false);
|
||||
addOffset('intro', 0, 0);
|
||||
// animation.addByPrefix('intro', "boyfriend dj intro", 24, false);
|
||||
addOffset('boyfriend dj intro', 8, 3);
|
||||
|
||||
animation.addByPrefix('idle', "Boyfriend DJ0", 24, false);
|
||||
addOffset('idle', -4, -426);
|
||||
// animation.addByPrefix('idle', "Boyfriend DJ0", 24, false);
|
||||
addOffset('Boyfriend DJ', 0, 0);
|
||||
|
||||
animation.addByPrefix('confirm', "Boyfriend DJ confirm", 24, false);
|
||||
addOffset('confirm', 40, -451);
|
||||
// animation.addByPrefix('confirm', "Boyfriend DJ confirm", 24, false);
|
||||
addOffset('Boyfriend DJ confirm', 0, 0);
|
||||
|
||||
animation.addByPrefix('spook', "bf dj afk0", 24, false);
|
||||
addOffset('spook', -3, -272);
|
||||
// animation.addByPrefix('spook', "bf dj afk0", 24, false);
|
||||
addOffset('bf dj afk', 0, 0);
|
||||
}
|
||||
|
||||
public function confirm():Void
|
||||
|
@ -125,15 +145,15 @@ class DJBoyfriend extends FlxSprite
|
|||
animOffsets[name] = [x, y];
|
||||
}
|
||||
|
||||
public function getCurrentAnimation():String
|
||||
override public function getCurrentAnimation():String
|
||||
{
|
||||
if (this.animation == null || this.animation.curAnim == null) return "";
|
||||
return this.animation.curAnim.name;
|
||||
if (this.anim == null || this.anim.curSymbol == null) return "";
|
||||
return this.anim.curSymbol.name;
|
||||
}
|
||||
|
||||
public function playAnimation(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
|
||||
public function playFlashAnimation(id:String, ?Force:Bool = false, ?Reverse:Bool = false, ?Frame:Int = 0):Void
|
||||
{
|
||||
animation.play(AnimName, Force, Reversed, Frame);
|
||||
anim.play(id, Force, Reverse, Frame);
|
||||
applyAnimOffset();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,12 +40,6 @@ class DifficultyStars extends FlxSpriteGroup
|
|||
|
||||
for (memb in flames.members)
|
||||
memb.shader = hsvShader;
|
||||
|
||||
FlxG.debugger.addTrackerProfile(new TrackerProfile(HSVShader, ["hue", "saturation", "value"]));
|
||||
FlxG.debugger.track(hsvShader);
|
||||
|
||||
FlxG.debugger.addTrackerProfile(new TrackerProfile(DifficultyStars, ["difficulty"]));
|
||||
FlxG.debugger.track(this);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float):Void
|
||||
|
|
|
@ -34,9 +34,6 @@ class FreeplayFlames extends FlxSpriteGroup
|
|||
};
|
||||
add(flame);
|
||||
}
|
||||
|
||||
FlxG.debugger.addTrackerProfile(new TrackerProfile(FreeplayFlames, ["flameTimer"]));
|
||||
FlxG.debugger.track(this);
|
||||
}
|
||||
|
||||
var properPositions:Bool = false;
|
||||
|
|
|
@ -42,12 +42,12 @@ class FlxSpriteOverlay extends FlxSprite
|
|||
|
||||
var sprRect = getScreenBounds();
|
||||
|
||||
dipshitBitmap.draw(camera.canvas, camera.canvas.transform.matrix);
|
||||
blendShader.setCamera(dipshitBitmap);
|
||||
// dipshitBitmap.draw(camera.canvas, camera.canvas.transform.matrix);
|
||||
// blendShader.setCamera(dipshitBitmap);
|
||||
|
||||
FlxG.bitmapLog.add(dipshitBitmap);
|
||||
// FlxG.bitmapLog.add(dipshitBitmap);
|
||||
|
||||
camera.drawPixels(_frame, framePixels, _matrix, colorTransform, blend, antialiasing, blendShader);
|
||||
camera.drawPixels(_frame, framePixels, _matrix, colorTransform, blend, antialiasing, shader);
|
||||
}
|
||||
|
||||
function copyToFlash(rect):openfl.geom.Rectangle
|
||||
|
|
Loading…
Reference in a new issue