1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-17 15:38:52 +00:00

in-game animation cutscene type beat

This commit is contained in:
Cameron Taylor 2021-04-17 23:19:33 -04:00
parent 8db0a2cced
commit 8f2b147d58
3 changed files with 129 additions and 75 deletions

62
source/FlxVideo.hx Normal file
View file

@ -0,0 +1,62 @@
package;
import flixel.FlxBasic;
import flixel.FlxG;
import flixel.FlxSprite;
import openfl.events.NetStatusEvent;
import openfl.media.Video;
import openfl.net.NetConnection;
import openfl.net.NetStream;
class FlxVideo extends FlxBasic
{
var video:Video;
var netStream:NetStream;
public var finishCallback:Void->Void;
/**
* Doesn't actually interact with Flixel shit, only just a pleasant to use class
*/
public function new(vidSrc:String)
{
super();
video = new Video();
video.x = 0;
video.y = 0;
FlxG.addChildBelowMouse(video);
var netConnection = new NetConnection();
netConnection.connect(null);
netStream = new NetStream(netConnection);
netStream.client = {onMetaData: client_onMetaData};
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
netStream.play(Paths.file(vidSrc));
}
public function finishVideo():Void
{
netStream.dispose();
FlxG.removeChild(video);
if (finishCallback != null)
finishCallback();
}
public function client_onMetaData(metaData:Dynamic)
{
video.attachNetStream(netStream);
video.width = FlxG.width;
video.height = FlxG.height;
}
private function netConnection_onNetStatus(event:NetStatusEvent):Void
{
if (event.info.code == 'NetStream.Play.Complete')
finishVideo();
}
}

View file

@ -933,6 +933,19 @@ class PlayState extends MusicBeatState
{
inCutscene = true;
var vid:FlxVideo = new FlxVideo('music/ughCutscene.mp4');
vid.finishCallback = function()
{
startCountdown();
cameraMovement();
};
FlxG.camera.zoom = defaultCamZoom * 1.2;
camFollow.x += 100;
camFollow.y += 100;
/*
FlxG.sound.playMusic(Paths.music('DISTORTO'), 0);
FlxG.sound.music.fadeIn(5, 0, 0.5);
@ -962,7 +975,8 @@ class PlayState extends MusicBeatState
{
boyfriend.playAnim('singUP');
// play sound
FlxG.sound.play(Paths.sound('bfBeep'), function() {
FlxG.sound.play(Paths.sound('bfBeep'), function()
{
boyfriend.playAnim('idle');
});
});
@ -992,7 +1006,7 @@ class PlayState extends MusicBeatState
camHUD.visible = true;
});
});
});
});*/
}
function gunsIntro()

View file

@ -62,18 +62,20 @@ class FlxSymbol extends FlxSprite
{
if (Reflect.hasField(element, 'ASI'))
{
var m3d = element.ASI.M3D;
var dumbassMatrix:Matrix = new Matrix(m3d[0], m3d[1], m3d[4], m3d[5], m3d[12], m3d[13]);
var spr:FlxSymbol = new FlxSymbol(0, 0, coolParsed);
matrixExposed = true;
spr.frames = frames;
spr.frame = spr.frames.getByName(element.ASI.N);
var m3d = element.ASI.M3D;
var dumbassMatrix:Matrix = new Matrix(m3d[0], m3d[1], m3d[4], m3d[5], m3d[12], m3d[13]);
// dumbassMatrix.translate(origin.x, origin.y);
dumbassMatrix.concat(_matrix);
spr.matrixExposed = true;
spr.transformMatrix.concat(dumbassMatrix);
// spr._matrix.concat(spr.transformMatrix);
spr.origin.set();
spr.origin.x += origin.x;
@ -85,39 +87,15 @@ class FlxSymbol extends FlxSprite
else
{
var nestedSymbol = symbolMap.get(element.SI.SN);
// nestedSymbol
// if (element.SI.M3D[0] == -1 || flipX)
// nestedShit.flipX = true;
// nestedSymbol.TL.L.reverse();
// _matrix.identity();
// _matrix.scale(1, 1);
var nestedShit:FlxSymbol = new FlxSymbol(x, y, coolParse);
var nestedShit:FlxSymbol = new FlxSymbol(0, 0, coolParse);
nestedShit.frames = frames;
var swagMatrix:FlxMatrix = new FlxMatrix(element.SI.M3D[0], element.SI.M3D[1], element.SI.M3D[4], element.SI.M3D[5],
element.SI.M3D[12], element.SI.M3D[13]);
// _matrix.concat(swagMatrix);
swagMatrix.concat(_matrix);
nestedShit._matrix.concat(swagMatrix);
// nestedShit.x = swagMatrix.tx;
// nestedShit.y = swagMatrix.ty;
// nestedShit._skewMatrix.identity();
// nestedShit._skewMatrix.concat(swagMatrix);
// _matrix.setTo(element.SI.M3D[0], element.SI.M3D[1], element.SI.M3D[4], element.SI.M3D[5], element.SI.M3D[12], element.SI.M3D[13]);
// nestedShit.scale.x = Math.sqrt(_matrix.a * _matrix.a + _matrix.b + _matrix.b);
// nestedShit.scale.y = Math.sqrt(_matrix.a * _matrix.a + _matrix.b * _matrix.b);
// nestedShit.origin.set(element.SI.TRP.x, element.SI.TRP.y);
nestedShit.origin.set(element.SI.TRP.x, element.SI.TRP.y);
// nestedShit.angle += ((180 / Math.PI) * Math.atan2(swagMatrix.b, swagMatrix.a));
// nestedShit.angle += angle;