mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-12-01 16:51:27 +00:00
Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret into nitpix
This commit is contained in:
commit
b309fa5ba2
|
|
@ -73,6 +73,14 @@ class Character extends FlxSprite
|
||||||
loadOffsetFile(curCharacter);
|
loadOffsetFile(curCharacter);
|
||||||
|
|
||||||
playAnim('danceRight');
|
playAnim('danceRight');
|
||||||
|
case 'gf-tankmen':
|
||||||
|
frames = Paths.getSparrowAtlas('characters/gfTankmen');
|
||||||
|
animation.addByIndices('sad', 'GF Crying at Gunpoint', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "", 24, true);
|
||||||
|
animation.addByIndices('danceLeft', 'GF Dancing at Gunpoint', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
||||||
|
animation.addByIndices('danceRight', 'GF Dancing at Gunpoint', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
||||||
|
|
||||||
|
loadOffsetFile('gf');
|
||||||
|
playAnim('danceRight');
|
||||||
|
|
||||||
case 'bf-holding-gf':
|
case 'bf-holding-gf':
|
||||||
frames = Paths.getSparrowAtlas('characters/bfAndGF');
|
frames = Paths.getSparrowAtlas('characters/bfAndGF');
|
||||||
|
|
@ -449,25 +457,31 @@ class Character extends FlxSprite
|
||||||
|
|
||||||
if (isPlayer)
|
if (isPlayer)
|
||||||
{
|
{
|
||||||
quickAnimAdd('singLEFT', 'Tankman Note Left0');
|
quickAnimAdd('singLEFT', 'Tankman Note Left ');
|
||||||
quickAnimAdd('singRIGHT', 'Tankman Right Note0');
|
quickAnimAdd('singRIGHT', 'Tankman Right Note ');
|
||||||
quickAnimAdd('singLEFTmiss', 'Tankman Note Left MISS');
|
quickAnimAdd('singLEFTmiss', 'Tankman Note Left MISS');
|
||||||
quickAnimAdd('singRIGHTmiss', 'Tankman Right Note MISS');
|
quickAnimAdd('singRIGHTmiss', 'Tankman Right Note MISS');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Need to be flipped! REDO THIS LATER
|
// Need to be flipped! REDO THIS LATER
|
||||||
quickAnimAdd('singLEFT', 'Tankman Right Note0');
|
quickAnimAdd('singLEFT', 'Tankman Right Note ');
|
||||||
quickAnimAdd('singRIGHT', 'Tankman Note Left0');
|
quickAnimAdd('singRIGHT', 'Tankman Note Left ');
|
||||||
quickAnimAdd('singLEFTmiss', 'Tankman Right Note MISS');
|
quickAnimAdd('singLEFTmiss', 'Tankman Right Note MISS');
|
||||||
quickAnimAdd('singRIGHTmiss', 'Tankman Note Left MISS');
|
quickAnimAdd('singRIGHTmiss', 'Tankman Note Left MISS');
|
||||||
}
|
}
|
||||||
|
|
||||||
quickAnimAdd('singUP', 'Tankman UP note0');
|
quickAnimAdd('singUP', 'Tankman UP note ');
|
||||||
quickAnimAdd('singDOWN', 'Tankman DOWN note0');
|
quickAnimAdd('singDOWN', 'Tankman DOWN note ');
|
||||||
quickAnimAdd('singUPmiss', 'Tankman UP note MISS');
|
quickAnimAdd('singUPmiss', 'Tankman UP note MISS');
|
||||||
quickAnimAdd('singDOWNmiss', 'Tankman DOWN note MISS');
|
quickAnimAdd('singDOWNmiss', 'Tankman DOWN note MISS');
|
||||||
|
|
||||||
|
// PRETTY GOOD tankman
|
||||||
|
// TANKMAN UGH instanc
|
||||||
|
|
||||||
|
quickAnimAdd('singDOWN-alt', 'PRETTY GOOD');
|
||||||
|
quickAnimAdd('singUP-alt', 'TANKMAN UGH');
|
||||||
|
|
||||||
loadOffsetFile(curCharacter);
|
loadOffsetFile(curCharacter);
|
||||||
|
|
||||||
playAnim('idle');
|
playAnim('idle');
|
||||||
|
|
@ -614,7 +628,7 @@ class Character extends FlxSprite
|
||||||
{
|
{
|
||||||
switch (curCharacter)
|
switch (curCharacter)
|
||||||
{
|
{
|
||||||
case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
|
case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel' | 'gf-tankmen':
|
||||||
if (!animation.curAnim.name.startsWith('hair'))
|
if (!animation.curAnim.name.startsWith('hair'))
|
||||||
{
|
{
|
||||||
danced = !danced;
|
danced = !danced;
|
||||||
|
|
@ -629,6 +643,10 @@ class Character extends FlxSprite
|
||||||
// lol weed
|
// lol weed
|
||||||
// playAnim('shoot' + FlxG.random.int(1, 4), true);
|
// playAnim('shoot' + FlxG.random.int(1, 4), true);
|
||||||
|
|
||||||
|
case 'tankman':
|
||||||
|
if (!animation.curAnim.name.endsWith('DOWN-alt'))
|
||||||
|
playAnim('idle');
|
||||||
|
|
||||||
case 'spooky':
|
case 'spooky':
|
||||||
danced = !danced;
|
danced = !danced;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -478,6 +478,9 @@ class ChartingState extends MusicBeatState
|
||||||
|
|
||||||
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps));
|
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps));
|
||||||
|
|
||||||
|
if (FlxG.keys.justPressed.X)
|
||||||
|
toggleAltAnimNote();
|
||||||
|
|
||||||
if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1))
|
if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1))
|
||||||
{
|
{
|
||||||
trace(curStep);
|
trace(curStep);
|
||||||
|
|
@ -686,6 +689,21 @@ class ChartingState extends MusicBeatState
|
||||||
updateGrid();
|
updateGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleAltAnimNote():Void
|
||||||
|
{
|
||||||
|
if (curSelectedNote != null)
|
||||||
|
{
|
||||||
|
if (curSelectedNote[3] != null)
|
||||||
|
{
|
||||||
|
trace('ALT NOTE SHIT');
|
||||||
|
curSelectedNote[3] = !curSelectedNote[3];
|
||||||
|
trace(curSelectedNote[3]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
curSelectedNote[3] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function recalculateSteps():Int
|
function recalculateSteps():Int
|
||||||
{
|
{
|
||||||
var lastChange:BPMChangeEvent = {
|
var lastChange:BPMChangeEvent = {
|
||||||
|
|
@ -945,14 +963,15 @@ class ChartingState extends MusicBeatState
|
||||||
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
||||||
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
||||||
var noteSus = 0;
|
var noteSus = 0;
|
||||||
|
var noteAlt = false;
|
||||||
|
|
||||||
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
|
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]);
|
||||||
|
|
||||||
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
||||||
|
|
||||||
if (FlxG.keys.pressed.CONTROL)
|
if (FlxG.keys.pressed.CONTROL)
|
||||||
{
|
{
|
||||||
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]);
|
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]);
|
||||||
}
|
}
|
||||||
|
|
||||||
trace(noteStrum);
|
trace(noteStrum);
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ class CutsceneCharacter extends FlxTypedGroup<FlxSprite>
|
||||||
{
|
{
|
||||||
cutScene.kill();
|
cutScene.kill();
|
||||||
cutScene.destroy();
|
cutScene.destroy();
|
||||||
|
cutScene = null;
|
||||||
|
|
||||||
if (daNum + 1 < arrayLMFAOOOO.length)
|
if (daNum + 1 < arrayLMFAOOOO.length)
|
||||||
createCutscene(daNum + 1);
|
createCutscene(daNum + 1);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,16 @@ class FreeplayState extends MusicBeatState
|
||||||
var lerpScore:Int = 0;
|
var lerpScore:Int = 0;
|
||||||
var intendedScore:Int = 0;
|
var intendedScore:Int = 0;
|
||||||
|
|
||||||
var coolColors:Array<Int> = [0xff223344, 0xff123456, 0xFFFFFFFF, 0xFFADAD];
|
var coolColors:Array<Int> = [
|
||||||
|
0xff9271fd,
|
||||||
|
0xff9271fd,
|
||||||
|
0xff223344,
|
||||||
|
0xFF941653,
|
||||||
|
0xFFfc96d7,
|
||||||
|
0xFFa0d1ff,
|
||||||
|
0xffff78bf,
|
||||||
|
0xfff6b604
|
||||||
|
];
|
||||||
|
|
||||||
private var grpSongs:FlxTypedGroup<Alphabet>;
|
private var grpSongs:FlxTypedGroup<Alphabet>;
|
||||||
private var curPlaying:Bool = false;
|
private var curPlaying:Bool = false;
|
||||||
|
|
@ -196,7 +205,7 @@ class FreeplayState extends MusicBeatState
|
||||||
}
|
}
|
||||||
|
|
||||||
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
|
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
|
||||||
bg.color = FlxColor.interpolate(bg.color, coolColors[curSelected % coolColors.length], 0.045);
|
bg.color = FlxColor.interpolate(bg.color, coolColors[songs[curSelected].week % coolColors.length], 0.045);
|
||||||
|
|
||||||
if (Math.abs(lerpScore - intendedScore) <= 10)
|
if (Math.abs(lerpScore - intendedScore) <= 10)
|
||||||
lerpScore = intendedScore;
|
lerpScore = intendedScore;
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,11 @@ class MainMenuState extends MusicBeatState
|
||||||
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
||||||
#if CAN_OPEN_LINKS
|
#if CAN_OPEN_LINKS
|
||||||
var hasPopupBlocker = #if web true #else false #end;
|
var hasPopupBlocker = #if web true #else false #end;
|
||||||
|
|
||||||
|
if (VideoState.seenVideo)
|
||||||
menuItems.createItem('kickstarter', selectDonate, hasPopupBlocker);
|
menuItems.createItem('kickstarter', selectDonate, hasPopupBlocker);
|
||||||
// menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
else
|
||||||
|
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
||||||
#end
|
#end
|
||||||
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
||||||
// #if newgrounds
|
// #if newgrounds
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,12 @@ class Note extends FlxSprite
|
||||||
public var tooLate:Bool = false;
|
public var tooLate:Bool = false;
|
||||||
public var wasGoodHit:Bool = false;
|
public var wasGoodHit:Bool = false;
|
||||||
public var prevNote:Note;
|
public var prevNote:Note;
|
||||||
|
|
||||||
private var willMiss:Bool = false;
|
private var willMiss:Bool = false;
|
||||||
|
|
||||||
|
public var altNote:Bool = false;
|
||||||
|
public var invisNote:Bool = false;
|
||||||
|
|
||||||
public var sustainLength:Float = 0;
|
public var sustainLength:Float = 0;
|
||||||
public var isSustainNote:Bool = false;
|
public var isSustainNote:Bool = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,21 @@ class NoteSplash extends FlxSprite
|
||||||
animation.addByPrefix('note0-1', 'note impact 2 purple', 24, false);
|
animation.addByPrefix('note0-1', 'note impact 2 purple', 24, false);
|
||||||
animation.addByPrefix('note3-1', 'note impact 2 red', 24, false);
|
animation.addByPrefix('note3-1', 'note impact 2 red', 24, false);
|
||||||
|
|
||||||
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1));
|
setupNoteSplash(x, y, noteData);
|
||||||
|
|
||||||
|
// alpha = 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupNoteSplash(x:Float, y:Float, noteData:Int = 0)
|
||||||
|
{
|
||||||
|
setPosition(x, y);
|
||||||
|
alpha = 0.6;
|
||||||
|
|
||||||
|
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
|
||||||
animation.curAnim.frameRate += FlxG.random.int(-2, 2);
|
animation.curAnim.frameRate += FlxG.random.int(-2, 2);
|
||||||
updateHitbox();
|
updateHitbox();
|
||||||
|
|
||||||
offset.set(width * 0.3, height * 0.3);
|
offset.set(width * 0.3, height * 0.3);
|
||||||
|
|
||||||
alpha = 0.75;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,8 @@ class PlayState extends MusicBeatState
|
||||||
var songScore:Int = 0;
|
var songScore:Int = 0;
|
||||||
var scoreTxt:FlxText;
|
var scoreTxt:FlxText;
|
||||||
|
|
||||||
|
var grpNoteSplashes:FlxTypedGroup<NoteSplash>;
|
||||||
|
|
||||||
public static var campaignScore:Int = 0;
|
public static var campaignScore:Int = 0;
|
||||||
|
|
||||||
var defaultCamZoom:Float = 1.05;
|
var defaultCamZoom:Float = 1.05;
|
||||||
|
|
@ -170,8 +172,11 @@ class PlayState extends MusicBeatState
|
||||||
FlxG.cameras.add(camHUD, false);
|
FlxG.cameras.add(camHUD, false);
|
||||||
|
|
||||||
// fake notesplash cache type deal so that it loads in the graphic?
|
// fake notesplash cache type deal so that it loads in the graphic?
|
||||||
|
|
||||||
|
grpNoteSplashes = new FlxTypedGroup<NoteSplash>();
|
||||||
|
|
||||||
var noteSplash:NoteSplash = new NoteSplash(100, 100, 0);
|
var noteSplash:NoteSplash = new NoteSplash(100, 100, 0);
|
||||||
add(noteSplash);
|
grpNoteSplashes.add(noteSplash);
|
||||||
noteSplash.alpha = 0.1;
|
noteSplash.alpha = 0.1;
|
||||||
|
|
||||||
persistentUpdate = true;
|
persistentUpdate = true;
|
||||||
|
|
@ -543,14 +548,14 @@ class PlayState extends MusicBeatState
|
||||||
tankWatchtower = new BGSprite('tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']);
|
tankWatchtower = new BGSprite('tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']);
|
||||||
add(tankWatchtower);
|
add(tankWatchtower);
|
||||||
|
|
||||||
|
tankmanRun = new FlxTypedGroup<TankmenBG>();
|
||||||
|
add(tankmanRun);
|
||||||
|
|
||||||
var tankGround:BGSprite = new BGSprite('tankGround', -420, -150);
|
var tankGround:BGSprite = new BGSprite('tankGround', -420, -150);
|
||||||
tankGround.setGraphicSize(Std.int(tankGround.width * 1.15));
|
tankGround.setGraphicSize(Std.int(tankGround.width * 1.15));
|
||||||
tankGround.updateHitbox();
|
tankGround.updateHitbox();
|
||||||
add(tankGround);
|
add(tankGround);
|
||||||
|
|
||||||
tankmanRun = new FlxTypedGroup<TankmenBG>();
|
|
||||||
add(tankmanRun);
|
|
||||||
|
|
||||||
// smokeLeft.screenCenter();
|
// smokeLeft.screenCenter();
|
||||||
|
|
||||||
var fgTank0:BGSprite = new BGSprite('tank0', -500, 650, 1.7, 1.5, ['fg']);
|
var fgTank0:BGSprite = new BGSprite('tank0', -500, 650, 1.7, 1.5, ['fg']);
|
||||||
|
|
@ -609,6 +614,8 @@ class PlayState extends MusicBeatState
|
||||||
gfVersion = 'gf-pixel';
|
gfVersion = 'gf-pixel';
|
||||||
case 'schoolEvil':
|
case 'schoolEvil':
|
||||||
gfVersion = 'gf-pixel';
|
gfVersion = 'gf-pixel';
|
||||||
|
case 'tank':
|
||||||
|
gfVersion = 'gf-tankmen';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SONG.song.toLowerCase() == 'stress')
|
if (SONG.song.toLowerCase() == 'stress')
|
||||||
|
|
@ -625,10 +632,12 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
for (i in 0...TankmenBG.animationNotes.length)
|
for (i in 0...TankmenBG.animationNotes.length)
|
||||||
{
|
{
|
||||||
if (FlxG.random.bool(50))
|
if (FlxG.random.bool(16))
|
||||||
{
|
{
|
||||||
var tankman:TankmenBG = new TankmenBG(500, 200 + FlxG.random.int(0, 150), TankmenBG.animationNotes[i][1] < 2);
|
var tankman:TankmenBG = tankmanRun.recycle(TankmenBG);
|
||||||
|
// new TankmenBG(500, 200 + FlxG.random.int(50, 100), TankmenBG.animationNotes[i][1] < 2);
|
||||||
tankman.strumTime = TankmenBG.animationNotes[i][0];
|
tankman.strumTime = TankmenBG.animationNotes[i][0];
|
||||||
|
tankman.resetShit(500, 200 + FlxG.random.int(50, 100), TankmenBG.animationNotes[i][1] < 2);
|
||||||
tankmanRun.add(tankman);
|
tankmanRun.add(tankman);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -730,7 +739,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
if (gfVersion != 'pico-speaker')
|
if (gfVersion != 'pico-speaker')
|
||||||
{
|
{
|
||||||
gf.x -= 80;
|
gf.x -= 170;
|
||||||
gf.y -= 75;
|
gf.y -= 75;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -772,6 +781,8 @@ class PlayState extends MusicBeatState
|
||||||
strumLineNotes = new FlxTypedGroup<FlxSprite>();
|
strumLineNotes = new FlxTypedGroup<FlxSprite>();
|
||||||
add(strumLineNotes);
|
add(strumLineNotes);
|
||||||
|
|
||||||
|
add(grpNoteSplashes);
|
||||||
|
|
||||||
playerStrums = new FlxTypedGroup<FlxSprite>();
|
playerStrums = new FlxTypedGroup<FlxSprite>();
|
||||||
|
|
||||||
// startCountdown();
|
// startCountdown();
|
||||||
|
|
@ -829,6 +840,7 @@ class PlayState extends MusicBeatState
|
||||||
iconP2.y = healthBar.y - (iconP2.height / 2);
|
iconP2.y = healthBar.y - (iconP2.height / 2);
|
||||||
add(iconP2);
|
add(iconP2);
|
||||||
|
|
||||||
|
grpNoteSplashes.cameras = [camHUD];
|
||||||
strumLineNotes.cameras = [camHUD];
|
strumLineNotes.cameras = [camHUD];
|
||||||
notes.cameras = [camHUD];
|
notes.cameras = [camHUD];
|
||||||
healthBar.cameras = [camHUD];
|
healthBar.cameras = [camHUD];
|
||||||
|
|
@ -903,8 +915,8 @@ class PlayState extends MusicBeatState
|
||||||
switch (curSong.toLowerCase())
|
switch (curSong.toLowerCase())
|
||||||
{
|
{
|
||||||
// REMOVE THIS LATER
|
// REMOVE THIS LATER
|
||||||
case 'stress':
|
// case 'stress':
|
||||||
stressIntro();
|
// stressIntro();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
|
|
@ -920,7 +932,7 @@ class PlayState extends MusicBeatState
|
||||||
FlxG.sound.music.fadeIn(5, 0, 0.5);
|
FlxG.sound.music.fadeIn(5, 0, 0.5);
|
||||||
|
|
||||||
dad.visible = false;
|
dad.visible = false;
|
||||||
var tankCutscene:FlxSprite = new FlxSprite(-20, 320);
|
var tankCutscene:TankCutscene = new TankCutscene(-20, 320);
|
||||||
tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong1');
|
tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong1');
|
||||||
tankCutscene.animation.addByPrefix('wellWell', 'TANK TALK 1 P1', 24, false);
|
tankCutscene.animation.addByPrefix('wellWell', 'TANK TALK 1 P1', 24, false);
|
||||||
tankCutscene.animation.addByPrefix('killYou', 'TANK TALK 1 P2', 24, false);
|
tankCutscene.animation.addByPrefix('killYou', 'TANK TALK 1 P2', 24, false);
|
||||||
|
|
@ -933,7 +945,7 @@ class PlayState extends MusicBeatState
|
||||||
FlxG.camera.zoom *= 1.2;
|
FlxG.camera.zoom *= 1.2;
|
||||||
camFollow.y += 100;
|
camFollow.y += 100;
|
||||||
|
|
||||||
FlxG.sound.play(Paths.sound('wellWellWell'));
|
tankCutscene.startSyncAudio = FlxG.sound.load(Paths.sound('wellWellWell'));
|
||||||
|
|
||||||
new FlxTimer().start(3, function(tmr:FlxTimer)
|
new FlxTimer().start(3, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
|
|
@ -990,14 +1002,14 @@ class PlayState extends MusicBeatState
|
||||||
FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.3}, 4, {ease: FlxEase.quadInOut});
|
FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.3}, 4, {ease: FlxEase.quadInOut});
|
||||||
|
|
||||||
dad.visible = false;
|
dad.visible = false;
|
||||||
var tankCutscene:FlxSprite = new FlxSprite(20, 320);
|
var tankCutscene:TankCutscene = new TankCutscene(20, 320);
|
||||||
tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong2');
|
tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong2');
|
||||||
tankCutscene.animation.addByPrefix('tankyguy', 'TANK TALK 2', 24, false);
|
tankCutscene.animation.addByPrefix('tankyguy', 'TANK TALK 2', 24, false);
|
||||||
tankCutscene.animation.play('tankyguy');
|
tankCutscene.animation.play('tankyguy');
|
||||||
tankCutscene.antialiasing = true;
|
tankCutscene.antialiasing = true;
|
||||||
gfCutsceneLayer.add(tankCutscene); // add();
|
gfCutsceneLayer.add(tankCutscene); // add();
|
||||||
|
|
||||||
FlxG.sound.play(Paths.sound('tankSong2'));
|
tankCutscene.startSyncAudio = FlxG.sound.load(Paths.sound('tankSong2'));
|
||||||
|
|
||||||
new FlxTimer().start(4.1, function(ugly:FlxTimer)
|
new FlxTimer().start(4.1, function(ugly:FlxTimer)
|
||||||
{
|
{
|
||||||
|
|
@ -1039,13 +1051,18 @@ class PlayState extends MusicBeatState
|
||||||
// for story mode shit
|
// for story mode shit
|
||||||
camFollow.setPosition(camPos.x, camPos.y);
|
camFollow.setPosition(camPos.x, camPos.y);
|
||||||
|
|
||||||
|
var dummyLoaderShit:FlxGroup = new FlxGroup();
|
||||||
|
|
||||||
|
add(dummyLoaderShit);
|
||||||
|
|
||||||
for (i in 0...7)
|
for (i in 0...7)
|
||||||
{
|
{
|
||||||
var dummyLoader:FlxSprite = new FlxSprite();
|
var dummyLoader:FlxSprite = new FlxSprite();
|
||||||
dummyLoader.loadGraphic(Paths.image('cutsceneStuff/gfHoldup-' + i));
|
dummyLoader.loadGraphic(Paths.image('cutsceneStuff/gfHoldup-' + i));
|
||||||
add(dummyLoader);
|
dummyLoaderShit.add(dummyLoader);
|
||||||
dummyLoader.alpha = 0.01;
|
dummyLoader.alpha = 0.01;
|
||||||
dummyLoader.y = FlxG.height - 20;
|
dummyLoader.y = FlxG.height - 20;
|
||||||
|
// dummyLoader.drawFrame(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
dad.visible = false;
|
dad.visible = false;
|
||||||
|
|
@ -1093,13 +1110,12 @@ class PlayState extends MusicBeatState
|
||||||
add(bfCatchGf);
|
add(bfCatchGf);
|
||||||
bfCatchGf.visible = false;
|
bfCatchGf.visible = false;
|
||||||
|
|
||||||
var cutsceneSound:FlxSound = new FlxSound();
|
|
||||||
|
|
||||||
if (PreferencesMenu.getPref('censor-naughty'))
|
if (PreferencesMenu.getPref('censor-naughty'))
|
||||||
cutsceneSound.loadEmbedded(Paths.sound('stressCutscene'));
|
tankCutscene.startSyncAudio = FlxG.sound.play(Paths.sound('stressCutscene'));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cutsceneSound.loadEmbedded(Paths.sound('song3censor'));
|
tankCutscene.startSyncAudio = FlxG.sound.play(Paths.sound('song3censor'));
|
||||||
|
// cutsceneSound.loadEmbedded(Paths.sound('song3censor'));
|
||||||
|
|
||||||
var censor:FlxSprite = new FlxSprite();
|
var censor:FlxSprite = new FlxSprite();
|
||||||
censor.frames = Paths.getSparrowAtlas('cutsceneStuff/censor');
|
censor.frames = Paths.getSparrowAtlas('cutsceneStuff/censor');
|
||||||
|
|
@ -1156,7 +1172,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
// new FlxTimer().start(0.01, function(tmr) cutsceneSound.play()); // cutsceneSound.play();
|
// new FlxTimer().start(0.01, function(tmr) cutsceneSound.play()); // cutsceneSound.play();
|
||||||
// cutsceneSound.play();
|
// cutsceneSound.play();
|
||||||
tankCutscene.startSyncAudio = cutsceneSound;
|
// tankCutscene.startSyncAudio = cutsceneSound;
|
||||||
// tankCutscene.animation.curAnim.curFrame
|
// tankCutscene.animation.curAnim.curFrame
|
||||||
|
|
||||||
FlxG.camera.zoom = defaultCamZoom * 1.15;
|
FlxG.camera.zoom = defaultCamZoom * 1.15;
|
||||||
|
|
@ -1242,6 +1258,10 @@ class PlayState extends MusicBeatState
|
||||||
dad.visible = true;
|
dad.visible = true;
|
||||||
bfTankCutsceneLayer.remove(alsoTankCutscene);
|
bfTankCutsceneLayer.remove(alsoTankCutscene);
|
||||||
startCountdown();
|
startCountdown();
|
||||||
|
remove(dummyLoaderShit);
|
||||||
|
dummyLoaderShit.destroy();
|
||||||
|
dummyLoaderShit = null;
|
||||||
|
|
||||||
gfCutsceneLayer.remove(cutsceneShit);
|
gfCutsceneLayer.remove(cutsceneShit);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -1250,7 +1270,7 @@ class PlayState extends MusicBeatState
|
||||||
function initDiscord():Void
|
function initDiscord():Void
|
||||||
{
|
{
|
||||||
#if discord_rpc
|
#if discord_rpc
|
||||||
storyDifficultyText = CoolUtil.difficultyString();
|
storyDifficultyText = difficultyString();
|
||||||
iconRPC = SONG.player2;
|
iconRPC = SONG.player2;
|
||||||
|
|
||||||
// To avoid having duplicate images in Discord assets
|
// To avoid having duplicate images in Discord assets
|
||||||
|
|
@ -1488,7 +1508,7 @@ class PlayState extends MusicBeatState
|
||||||
lastReportedPlayheadPosition = 0;
|
lastReportedPlayheadPosition = 0;
|
||||||
|
|
||||||
if (!paused)
|
if (!paused)
|
||||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
FlxG.sound.playMusic(Paths.inst(SONG.song), 1, false);
|
||||||
FlxG.sound.music.onComplete = endSong;
|
FlxG.sound.music.onComplete = endSong;
|
||||||
vocals.play();
|
vocals.play();
|
||||||
|
|
||||||
|
|
@ -1513,7 +1533,7 @@ class PlayState extends MusicBeatState
|
||||||
curSong = songData.song;
|
curSong = songData.song;
|
||||||
|
|
||||||
if (SONG.needsVoices)
|
if (SONG.needsVoices)
|
||||||
vocals = new FlxSound().loadEmbedded(Paths.voices(PlayState.SONG.song));
|
vocals = new FlxSound().loadEmbedded(Paths.voices(SONG.song));
|
||||||
else
|
else
|
||||||
vocals = new FlxSound();
|
vocals = new FlxSound();
|
||||||
|
|
||||||
|
|
@ -1558,6 +1578,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
|
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
|
||||||
swagNote.sustainLength = songNotes[2];
|
swagNote.sustainLength = songNotes[2];
|
||||||
|
swagNote.altNote = songNotes[3];
|
||||||
swagNote.scrollFactor.set(0, 0);
|
swagNote.scrollFactor.set(0, 0);
|
||||||
|
|
||||||
var susLength:Float = swagNote.sustainLength;
|
var susLength:Float = swagNote.sustainLength;
|
||||||
|
|
@ -1958,9 +1979,9 @@ class PlayState extends MusicBeatState
|
||||||
FlxG.switchState(new AnimationDebug(SONG.player2));
|
FlxG.switchState(new AnimationDebug(SONG.player2));
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null)
|
if (generatedMusic && SONG.notes[Std.int(curStep / 16)] != null)
|
||||||
{
|
{
|
||||||
cameraRightSide = PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection;
|
cameraRightSide = SONG.notes[Std.int(curStep / 16)].mustHitSection;
|
||||||
|
|
||||||
cameraMovement();
|
cameraMovement();
|
||||||
}
|
}
|
||||||
|
|
@ -2033,6 +2054,8 @@ class PlayState extends MusicBeatState
|
||||||
vocals.stop();
|
vocals.stop();
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
|
// unloadAssets();
|
||||||
|
|
||||||
deathCounter += 1;
|
deathCounter += 1;
|
||||||
|
|
||||||
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||||
|
|
@ -2124,6 +2147,9 @@ class PlayState extends MusicBeatState
|
||||||
altAnim = '-alt';
|
altAnim = '-alt';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (daNote.altNote)
|
||||||
|
altAnim = '-alt';
|
||||||
|
|
||||||
switch (Math.abs(daNote.noteData))
|
switch (Math.abs(daNote.noteData))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -2147,7 +2173,7 @@ class PlayState extends MusicBeatState
|
||||||
}
|
}
|
||||||
|
|
||||||
// WIP interpolation shit? Need to fix the pause issue
|
// WIP interpolation shit? Need to fix the pause issue
|
||||||
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed));
|
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * SONG.speed));
|
||||||
|
|
||||||
var noteMiss:Bool = daNote.y < -daNote.height;
|
var noteMiss:Bool = daNote.y < -daNote.height;
|
||||||
|
|
||||||
|
|
@ -2206,7 +2232,13 @@ class PlayState extends MusicBeatState
|
||||||
transIn = FlxTransitionableState.defaultTransIn;
|
transIn = FlxTransitionableState.defaultTransIn;
|
||||||
transOut = FlxTransitionableState.defaultTransOut;
|
transOut = FlxTransitionableState.defaultTransOut;
|
||||||
|
|
||||||
|
switch (PlayState.storyWeek)
|
||||||
|
{
|
||||||
|
case 7:
|
||||||
|
FlxG.switchState(new VideoState());
|
||||||
|
default:
|
||||||
FlxG.switchState(new StoryMenuState());
|
FlxG.switchState(new StoryMenuState());
|
||||||
|
}
|
||||||
|
|
||||||
// if ()
|
// if ()
|
||||||
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
||||||
|
|
@ -2231,7 +2263,7 @@ class PlayState extends MusicBeatState
|
||||||
difficulty = '-hard';
|
difficulty = '-hard';
|
||||||
|
|
||||||
trace('LOADING NEXT SONG');
|
trace('LOADING NEXT SONG');
|
||||||
trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty);
|
trace(storyPlaylist[0].toLowerCase() + difficulty);
|
||||||
|
|
||||||
if (SONG.song.toLowerCase() == 'eggnog')
|
if (SONG.song.toLowerCase() == 'eggnog')
|
||||||
{
|
{
|
||||||
|
|
@ -2248,7 +2280,7 @@ class PlayState extends MusicBeatState
|
||||||
FlxTransitionableState.skipNextTransOut = true;
|
FlxTransitionableState.skipNextTransOut = true;
|
||||||
prevCamFollow = camFollow;
|
prevCamFollow = camFollow;
|
||||||
|
|
||||||
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
|
SONG = Song.loadFromJson(storyPlaylist[0].toLowerCase() + difficulty, storyPlaylist[0]);
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
LoadingState.loadAndSwitchState(new PlayState());
|
LoadingState.loadAndSwitchState(new PlayState());
|
||||||
|
|
@ -2257,6 +2289,7 @@ class PlayState extends MusicBeatState
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trace('WENT BACK TO FREEPLAY??');
|
trace('WENT BACK TO FREEPLAY??');
|
||||||
|
// unloadAssets();
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2304,12 +2337,14 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
if (isSick)
|
if (isSick)
|
||||||
{
|
{
|
||||||
var noteSplash:NoteSplash = new NoteSplash(daNote.x, daNote.y, daNote.noteData);
|
var noteSplash:NoteSplash = grpNoteSplashes.recycle(NoteSplash);
|
||||||
add(noteSplash);
|
noteSplash.setupNoteSplash(daNote.x, daNote.y, daNote.noteData);
|
||||||
|
// new NoteSplash(daNote.x, daNote.y, daNote.noteData);
|
||||||
noteSplash.cameras = [camHUD];
|
grpNoteSplashes.add(noteSplash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only add the score if you're not on practice mode
|
||||||
|
if (!practiceMode)
|
||||||
songScore += score;
|
songScore += score;
|
||||||
|
|
||||||
/* if (combo > 60)
|
/* if (combo > 60)
|
||||||
|
|
@ -2619,6 +2654,7 @@ class PlayState extends MusicBeatState
|
||||||
}
|
}
|
||||||
combo = 0;
|
combo = 0;
|
||||||
|
|
||||||
|
if (!practiceMode)
|
||||||
songScore -= 10;
|
songScore -= 10;
|
||||||
|
|
||||||
FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
|
FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,17 @@ class TankmenBG extends FlxSprite
|
||||||
animation.play('run');
|
animation.play('run');
|
||||||
animation.curAnim.curFrame = FlxG.random.int(0, animation.curAnim.numFrames - 1);
|
animation.curAnim.curFrame = FlxG.random.int(0, animation.curAnim.numFrames - 1);
|
||||||
|
|
||||||
|
updateHitbox();
|
||||||
|
|
||||||
|
setGraphicSize(Std.int(width * 0.8));
|
||||||
|
updateHitbox();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function resetShit(x:Float, y:Float, isGoingRight:Bool)
|
||||||
|
{
|
||||||
|
setPosition(x, y);
|
||||||
goingRight = isGoingRight;
|
goingRight = isGoingRight;
|
||||||
endingOffset = FlxG.random.float(50, 200);
|
endingOffset = FlxG.random.float(50, 200);
|
||||||
|
|
||||||
tankSpeed = FlxG.random.float(0.6, 1);
|
tankSpeed = FlxG.random.float(0.6, 1);
|
||||||
|
|
||||||
if (goingRight)
|
if (goingRight)
|
||||||
|
|
|
||||||
|
|
@ -109,9 +109,13 @@ class TitleState extends MusicBeatState
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
#elseif CHARTING
|
#elseif CHARTING
|
||||||
FlxG.switchState(new ChartingState());
|
FlxG.switchState(new ChartingState());
|
||||||
|
/*
|
||||||
#elseif web
|
#elseif web
|
||||||
|
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
|
|
||||||
video = new Video();
|
video = new Video();
|
||||||
FlxG.stage.addChild(video);
|
FlxG.stage.addChild(video);
|
||||||
|
|
||||||
|
|
@ -130,8 +134,10 @@ class TitleState extends MusicBeatState
|
||||||
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
|
||||||
overlay.buttonMode = true;
|
overlay.buttonMode = true;
|
||||||
FlxG.stage.addChild(overlay);
|
// FlxG.stage.addChild(overlay);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
#else
|
#else
|
||||||
|
|
@ -157,6 +163,7 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
video.width = video.videoWidth;
|
video.width = video.videoWidth;
|
||||||
video.height = video.videoHeight;
|
video.height = video.videoHeight;
|
||||||
|
// video.
|
||||||
}
|
}
|
||||||
|
|
||||||
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
||||||
|
|
@ -168,8 +175,8 @@ class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
if (event.info.code == 'NetStream.Play.Complete')
|
if (event.info.code == 'NetStream.Play.Complete')
|
||||||
{
|
{
|
||||||
netStream.dispose();
|
// netStream.dispose();
|
||||||
FlxG.stage.removeChild(video);
|
// FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
startIntro();
|
startIntro();
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +186,10 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
private function overlay_onMouseDown(event:MouseEvent):Void
|
private function overlay_onMouseDown(event:MouseEvent):Void
|
||||||
{
|
{
|
||||||
netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
netStream.soundTransform.volume = 0.2;
|
||||||
|
netStream.soundTransform.pan = -1;
|
||||||
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
FlxG.stage.removeChild(overlay);
|
FlxG.stage.removeChild(overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -306,6 +316,9 @@ class TitleState extends MusicBeatState
|
||||||
else
|
else
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.onComplete = function() FlxG.switchState(new VideoState());
|
||||||
|
|
||||||
// credGroup.add(credTextShit);
|
// credGroup.add(credTextShit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -378,6 +391,9 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
if (pressedEnter && !transitioning && skippedIntro)
|
if (pressedEnter && !transitioning && skippedIntro)
|
||||||
{
|
{
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.onComplete = null;
|
||||||
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
NGio.unlockMedal(60960);
|
NGio.unlockMedal(60960);
|
||||||
|
|
||||||
// If it's Friday according to da clock
|
// If it's Friday according to da clock
|
||||||
|
|
@ -423,16 +439,18 @@ class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
skipIntro();
|
skipIntro();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
#if web
|
#if web
|
||||||
if (!initialized && controls.ACCEPT)
|
if (!initialized && controls.ACCEPT)
|
||||||
{
|
{
|
||||||
netStream.dispose();
|
// netStream.dispose();
|
||||||
FlxG.stage.removeChild(video);
|
// FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
startIntro();
|
startIntro();
|
||||||
|
skipIntro();
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
*/
|
||||||
|
|
||||||
// if (FlxG.keys.justPressed.SPACE)
|
// if (FlxG.keys.justPressed.SPACE)
|
||||||
// swagShader.hasOutline = !swagShader.hasOutline;
|
// swagShader.hasOutline = !swagShader.hasOutline;
|
||||||
|
|
|
||||||
99
source/VideoState.hx
Normal file
99
source/VideoState.hx
Normal file
|
|
@ -0,0 +1,99 @@
|
||||||
|
package;
|
||||||
|
|
||||||
|
import flixel.FlxG;
|
||||||
|
import openfl.display.Sprite;
|
||||||
|
import openfl.events.AsyncErrorEvent;
|
||||||
|
import openfl.events.MouseEvent;
|
||||||
|
import openfl.events.NetStatusEvent;
|
||||||
|
import openfl.media.Video;
|
||||||
|
import openfl.net.NetConnection;
|
||||||
|
import openfl.net.NetStream;
|
||||||
|
|
||||||
|
class VideoState extends MusicBeatState
|
||||||
|
{
|
||||||
|
var video:Video;
|
||||||
|
var netStream:NetStream;
|
||||||
|
private var overlay:Sprite;
|
||||||
|
|
||||||
|
public static var seenVideo:Bool = false;
|
||||||
|
|
||||||
|
override function create()
|
||||||
|
{
|
||||||
|
super.create();
|
||||||
|
|
||||||
|
seenVideo = true;
|
||||||
|
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
|
video = new Video();
|
||||||
|
FlxG.addChildBelowMouse(video);
|
||||||
|
|
||||||
|
var netConnection = new NetConnection();
|
||||||
|
netConnection.connect(null);
|
||||||
|
|
||||||
|
netStream = new NetStream(netConnection);
|
||||||
|
netStream.client = {onMetaData: client_onMetaData};
|
||||||
|
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
||||||
|
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
||||||
|
// netStream.addEventListener(NetStatusEvent.NET_STATUS);
|
||||||
|
netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
overlay = new Sprite();
|
||||||
|
overlay.graphics.beginFill(0, 0.5);
|
||||||
|
overlay.graphics.drawRect(0, 0, 1280, 720);
|
||||||
|
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
|
||||||
|
overlay.buttonMode = true;
|
||||||
|
// FlxG.stage.addChild(overlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
override function update(elapsed:Float)
|
||||||
|
{
|
||||||
|
if (controls.ACCEPT)
|
||||||
|
finishVid();
|
||||||
|
|
||||||
|
super.update(elapsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
function finishVid():Void
|
||||||
|
{
|
||||||
|
netStream.dispose();
|
||||||
|
FlxG.removeChild(video);
|
||||||
|
|
||||||
|
FlxG.switchState(new TitleState());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function client_onMetaData(metaData:Dynamic)
|
||||||
|
{
|
||||||
|
video.attachNetStream(netStream);
|
||||||
|
|
||||||
|
video.width = video.videoWidth;
|
||||||
|
video.height = video.videoHeight;
|
||||||
|
// video.
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
||||||
|
{
|
||||||
|
trace("Error loading video");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netConnection_onNetStatus(event:NetStatusEvent):Void
|
||||||
|
{
|
||||||
|
if (event.info.code == 'NetStream.Play.Complete')
|
||||||
|
{
|
||||||
|
finishVid();
|
||||||
|
}
|
||||||
|
|
||||||
|
trace(event.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function overlay_onMouseDown(event:MouseEvent):Void
|
||||||
|
{
|
||||||
|
netStream.soundTransform.volume = 0.2;
|
||||||
|
netStream.soundTransform.pan = -1;
|
||||||
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
FlxG.stage.removeChild(overlay);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue