From 29a5802a5b2e3f62f2f1bdd77dff04e50bc24a00 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 7 Apr 2021 20:19:49 -0400 Subject: [PATCH 1/2] cutscene shit in progress --- source/CutsceneCharacter.hx | 1 + source/DebugBoundingState.hx | 35 +++++++++ source/FreeplayState.hx | 4 ++ source/PlayState.hx | 133 +++++++++++++++++++++++++++++++++++ source/TitleState.hx | 20 ------ 5 files changed, 173 insertions(+), 20 deletions(-) create mode 100644 source/DebugBoundingState.hx diff --git a/source/CutsceneCharacter.hx b/source/CutsceneCharacter.hx index 0073007b1..823fa2e74 100644 --- a/source/CutsceneCharacter.hx +++ b/source/CutsceneCharacter.hx @@ -50,6 +50,7 @@ class CutsceneCharacter extends FlxTypedGroup cutScene.frames = Paths.getSparrowAtlas('cutsceneStuff/' + imageShit + "-" + daNum); cutScene.animation.addByPrefix('weed', arrayLMFAOOOO[daNum], 24, false); cutScene.animation.play('weed'); + cutScene.antialiasing = true; cutScene.animation.finishCallback = function(anim:String) { diff --git a/source/DebugBoundingState.hx b/source/DebugBoundingState.hx new file mode 100644 index 000000000..44b54f6b7 --- /dev/null +++ b/source/DebugBoundingState.hx @@ -0,0 +1,35 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.FlxState; +import openfl.Assets; +import sys.io.File; + +class DebugBoundingState extends FlxState +{ + override function create() + { + var bf:FlxSprite = new FlxSprite().loadGraphic(Paths.image('characters/temp')); + add(bf); + + FlxG.stage.window.onDropFile.add(function(path:String) + { + trace("DROPPED FILE FROM: " + Std.string(path)); + var newPath = "./" + Paths.image('characters/temp'); + File.copy(path, newPath); + + var swag = Paths.image('characters/temp'); + + if (bf != null) + remove(bf); + FlxG.bitmap.removeByKey(Paths.image('characters/temp')); + Assets.cache.clear(); + + bf.loadGraphic(Paths.image('characters/temp')); + add(bf); + }); + + super.create(); + } +} diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 2297439e3..31c66971a 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -1,4 +1,5 @@ package; + #if discord_rpc import Discord.DiscordClient; #end @@ -213,6 +214,9 @@ class FreeplayState extends MusicBeatState changeSelection(1); } + if (FlxG.mouse.wheel != 0) + changeSelection(-Math.round(FlxG.mouse.wheel / 4)); + if (controls.UI_LEFT_P) changeDiff(-1); if (controls.UI_RIGHT_P) diff --git a/source/PlayState.hx b/source/PlayState.hx index 45be5532a..b7224d7b5 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -20,6 +20,7 @@ import flixel.addons.transition.FlxTransitionableState; import flixel.graphics.atlas.FlxAtlas; import flixel.graphics.frames.FlxAtlasFrames; import flixel.group.FlxGroup.FlxTypedGroup; +import flixel.group.FlxGroup; import flixel.math.FlxMath; import flixel.math.FlxPoint; import flixel.math.FlxRect; @@ -121,6 +122,7 @@ class PlayState extends MusicBeatState var wiggleShit:WiggleEffect = new WiggleEffect(); var tankmanRun:FlxTypedGroup; + var gfCutsceneLayer:FlxGroup; var talking:Bool = true; var songScore:Int = 0; @@ -731,6 +733,9 @@ class PlayState extends MusicBeatState add(gf); + gfCutsceneLayer = new FlxGroup(); + add(gfCutsceneLayer); + // Shitty layering but whatev it works LOL if (curStage == 'limo') add(limo); @@ -872,6 +877,7 @@ class PlayState extends MusicBeatState schoolIntro(doof); case 'thorns': schoolIntro(doof); + default: startCountdown(); } @@ -880,6 +886,11 @@ class PlayState extends MusicBeatState { switch (curSong.toLowerCase()) { + case 'ugh': + ughIntro(); + case 'stress': + stressIntro(); + default: startCountdown(); } @@ -888,6 +899,126 @@ class PlayState extends MusicBeatState super.create(); } + function ughIntro() + { + dad.visible = false; + var tankCutscene:FlxSprite = new FlxSprite(-20, 320); + tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong1'); + tankCutscene.animation.addByPrefix('wellWell', 'TANK TALK 1 P1', 24, false); + tankCutscene.animation.addByPrefix('killYou', 'TANK TALK 1 P2', 24, false); + tankCutscene.animation.play('wellWell'); + tankCutscene.antialiasing = true; + add(tankCutscene); + + camHUD.visible = false; + + FlxG.camera.zoom *= 1.2; + camFollow.y += 100; + + FlxG.sound.play(Paths.sound('wellWellWell')); + + new FlxTimer().start(3, function(tmr:FlxTimer) + { + camFollow.x += 800; + camFollow.y += 100; + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 0.27, {ease: FlxEase.quadInOut}); + + new FlxTimer().start(1.5, function(bep:FlxTimer) + { + boyfriend.playAnim('singUP'); + // play sound + FlxG.sound.play(Paths.sound('bfBeep')); + }); + + new FlxTimer().start(3, function(swaggy:FlxTimer) + { + camFollow.x -= 800; + camFollow.y -= 100; + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 0.5, {ease: FlxEase.quadInOut}); + tankCutscene.animation.play('killYou'); + FlxG.sound.play(Paths.sound('killYou')); + new FlxTimer().start(6.1, function(swagasdga:FlxTimer) + { + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, (Conductor.crochet / 1000) * 5, {ease: FlxEase.quadInOut}); + + new FlxTimer().start((Conductor.crochet / 1000) * 5, function(money:FlxTimer) + { + dad.visible = true; + remove(tankCutscene); + }); + + cameraMovement(); + + startCountdown(); + camHUD.visible = true; + }); + }); + }); + } + + function stressIntro() + { + for (i in 0...5) + { + var dummyLoader:FlxSprite = new FlxSprite(); + dummyLoader.loadGraphic(Paths.image('cutsceneStuff/gfHoldup-' + i)); + add(dummyLoader); + dummyLoader.alpha = 0.01; + dummyLoader.y = FlxG.height - 20; + } + + camFollow.setPosition(gf.x + 350, gf.y + 560); + + var bfCatchGf:FlxSprite = new FlxSprite(boyfriend.x - 10, boyfriend.y - 90); + bfCatchGf.frames = Paths.getSparrowAtlas('cutsceneStuff/bfCatchesGF'); + bfCatchGf.animation.addByPrefix('catch', 'BF catches GF', 24, false); + bfCatchGf.antialiasing = true; + add(bfCatchGf); + bfCatchGf.visible = false; + + var cutsceneSound:FlxSound = new FlxSound(); + cutsceneSound.loadEmbedded(Paths.sound('stressCutscene')); + + cutsceneSound.play(); + + // cutsceneSound.onComplete = startCountdown; + + new FlxTimer().start(15.1, function(tmr:FlxTimer) + { + camFollow.y -= 170; + FlxTween.tween(FlxG.camera, {zoom: FlxG.camera.zoom * 1.3}, 2.1, { + ease: FlxEase.quadInOut, + onComplete: function(twen:FlxTween) + { + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 0.7, {ease: FlxEase.elasticOut}); + } + }); + + new FlxTimer().start(2.2, function(swagTimer:FlxTimer) + { + camFollow.y += 170; + boyfriend.visible = false; + bfCatchGf.visible = true; + bfCatchGf.animation.play('catch'); + bfCatchGf.animation.finishCallback = function(anim:String) + { + bfCatchGf.visible = false; + boyfriend.visible = true; + }; + }); + + gf.visible = false; + var cutsceneShit:CutsceneCharacter = new CutsceneCharacter(210, 70, 'gfHoldup'); + gfCutsceneLayer.add(cutsceneShit); + // add(cutsceneShit); + new FlxTimer().start(20, function(alsoTmr:FlxTimer) + { + startCountdown(); + gfCutsceneLayer.remove(cutsceneShit); + }); + }); + } + function initDiscord():Void { #if discord_rpc @@ -1003,6 +1134,8 @@ class PlayState extends MusicBeatState function startCountdown():Void { + gf.visible = true; + inCutscene = false; generateStaticArrows(0); diff --git a/source/TitleState.hx b/source/TitleState.hx index 09fdb1ad2..3f85c359e 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -56,26 +56,6 @@ class TitleState extends MusicBeatState // FlxG.bitmap.clearCache(); #end - /* - - FlxG.stage.window.onDropFile.add(function(path:String) - { - trace("DROPPED FILE FROM: " + Std.string(path)); - var newPath = "./" + Paths.image('gfDanceTitle'); - File.copy(path, newPath); - - var swag = Paths.image('gfDanceTitle'); - - if (gfDance != null) - remove(gfDance); - FlxG.bitmap.removeByKey(Paths.image('gfDanceTitle')); - Assets.cache.clear(); - - gfDance.loadGraphic(Paths.image('gfDanceTitle')); - add(gfDance); - }); - */ - swagShader = new ColorSwap(); FlxG.sound.muteKeys = [ZERO]; From 7c75bfaf31f8209d426e00a2ea15b4a1d49d45b3 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 8 Apr 2021 12:33:19 -0400 Subject: [PATCH 2/2] tank cutscene GUNS --- source/PlayState.hx | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index b7224d7b5..b3a473338 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -890,6 +890,8 @@ class PlayState extends MusicBeatState ughIntro(); case 'stress': stressIntro(); + case 'guns': + gunsIntro(); default: startCountdown(); @@ -908,7 +910,7 @@ class PlayState extends MusicBeatState tankCutscene.animation.addByPrefix('killYou', 'TANK TALK 1 P2', 24, false); tankCutscene.animation.play('wellWell'); tankCutscene.antialiasing = true; - add(tankCutscene); + gfCutsceneLayer.add(tankCutscene); camHUD.visible = false; @@ -944,7 +946,7 @@ class PlayState extends MusicBeatState new FlxTimer().start((Conductor.crochet / 1000) * 5, function(money:FlxTimer) { dad.visible = true; - remove(tankCutscene); + gfCutsceneLayer.remove(tankCutscene); }); cameraMovement(); @@ -956,6 +958,37 @@ class PlayState extends MusicBeatState }); } + function gunsIntro() + { + camFollow.y += 100; + + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.3}, 4, {ease: FlxEase.quadInOut}); + + dad.visible = false; + var tankCutscene:FlxSprite = new FlxSprite(20, 320); + tankCutscene.frames = Paths.getSparrowAtlas('cutsceneStuff/tankTalkSong2'); + tankCutscene.animation.addByPrefix('tankyguy', 'tankyguy', 24, false); + tankCutscene.animation.play('tankyguy'); + tankCutscene.antialiasing = true; + gfCutsceneLayer.add(tankCutscene); // add(); + + FlxG.sound.play(Paths.sound('tankSong2')); + + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.4}, 0.4, {ease: FlxEase.quadOut, startDelay: 4.1}); + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.3}, 0.7, {ease: FlxEase.quadInOut, startDelay: 4.55}); + + new FlxTimer().start(11, function(tmr:FlxTimer) + { + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, (Conductor.crochet * 9) / 1000, {ease: FlxEase.quartInOut}); + startCountdown(); + new FlxTimer().start((Conductor.crochet * 25) / 1000, function(daTim:FlxTimer) + { + dad.visible = true; + gfCutsceneLayer.remove(tankCutscene); + }); + }); + } + function stressIntro() { for (i in 0...5)