mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-23 15:26:06 +00:00
video stuff in progress
This commit is contained in:
parent
0951b672e7
commit
956b5b94fd
|
@ -40,6 +40,8 @@
|
|||
|
||||
<classpath name="source" />
|
||||
|
||||
<assets path='assets/preload/music' include="*mp4" embed='false' />
|
||||
|
||||
<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>
|
||||
|
||||
|
@ -120,6 +122,7 @@
|
|||
<haxelib name="newgrounds"/>
|
||||
<haxelib name="faxe" if='switch'/>
|
||||
<haxelib name="polymod"/>
|
||||
<haxelib name="openfl-webm" />
|
||||
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
|
||||
|
||||
<!-- <haxelib name="markdown" /> -->
|
||||
|
|
|
@ -43,13 +43,11 @@ class FreeplayState extends MusicBeatState
|
|||
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
|
||||
}
|
||||
|
||||
/*
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
if (!FlxG.sound.music.playing)
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
*/
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
if (!FlxG.sound.music.playing)
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
|
||||
var isDebug:Bool = false;
|
||||
|
||||
|
@ -179,9 +177,12 @@ class FreeplayState extends MusicBeatState
|
|||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (FlxG.sound.music.volume < 0.7)
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
||||
if (FlxG.sound.music.volume < 0.7)
|
||||
{
|
||||
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
||||
}
|
||||
}
|
||||
|
||||
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
|
||||
|
|
|
@ -6,7 +6,13 @@ import openfl.Assets;
|
|||
import openfl.Lib;
|
||||
import openfl.display.FPS;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.events.AsyncErrorEvent;
|
||||
import openfl.events.Event;
|
||||
import openfl.events.MouseEvent;
|
||||
import openfl.events.NetStatusEvent;
|
||||
import openfl.media.Video;
|
||||
import openfl.net.NetConnection;
|
||||
import openfl.net.NetStream;
|
||||
|
||||
class Main extends Sprite
|
||||
{
|
||||
|
@ -49,6 +55,10 @@ class Main extends Sprite
|
|||
setupGame();
|
||||
}
|
||||
|
||||
var video:Video;
|
||||
var netStream:NetStream;
|
||||
private var overlay:Sprite;
|
||||
|
||||
private function setupGame():Void
|
||||
{
|
||||
var stageWidth:Int = Lib.current.stage.stageWidth;
|
||||
|
@ -72,5 +82,52 @@ class Main extends Sprite
|
|||
#if !mobile
|
||||
addChild(new FPS(10, 3, 0xFFFFFF));
|
||||
#end
|
||||
/*
|
||||
video = new Video();
|
||||
addChild(video);
|
||||
|
||||
var netConnection = new NetConnection();
|
||||
netConnection.connect(null);
|
||||
|
||||
netStream = new NetStream(netConnection);
|
||||
netStream.client = {onMetaData: client_onMetaData};
|
||||
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
||||
|
||||
#if (js && html5)
|
||||
overlay = new Sprite();
|
||||
overlay.graphics.beginFill(0, 0.5);
|
||||
overlay.graphics.drawRect(0, 0, 560, 320);
|
||||
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||
overlay.buttonMode = true;
|
||||
addChild(overlay);
|
||||
|
||||
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
||||
#else
|
||||
netStream.play("assets/preload/music/dredd.mp4");
|
||||
#end
|
||||
*/
|
||||
}
|
||||
/*
|
||||
private function client_onMetaData(metaData:Dynamic)
|
||||
{
|
||||
video.attachNetStream(netStream);
|
||||
|
||||
video.width = video.videoWidth;
|
||||
video.height = video.videoHeight;
|
||||
}
|
||||
|
||||
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
||||
{
|
||||
trace("Error loading video");
|
||||
}
|
||||
|
||||
private function netConnection_onNetStatus(event:NetStatusEvent):Void
|
||||
{
|
||||
}
|
||||
|
||||
private function overlay_onMouseDown(event:MouseEvent):Void
|
||||
{
|
||||
netStream.play("assets/preload/music/dredd.mp4");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -2,20 +2,14 @@ package;
|
|||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxState;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.system.ui.FlxSoundTray;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
|
@ -45,7 +39,7 @@ class TitleState extends MusicBeatState
|
|||
#if polymod
|
||||
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||
#end
|
||||
|
||||
|
||||
PlayerSettings.init();
|
||||
|
||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||
|
|
Loading…
Reference in a new issue